惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Full Disclosure
博客园 - 三生石上(FineUI控件)
MyScale Blog
MyScale Blog
Apple Machine Learning Research
Apple Machine Learning Research
L
LINUX DO - 最新话题
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
宝玉的分享
宝玉的分享
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
GbyAI
GbyAI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
Visual Studio Blog
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园_首页
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
月光博客
月光博客
博客园 - 叶小钗
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
D
DataBreaches.Net
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog RSS Feed
量子位
美团技术团队
Vercel News
Vercel News
Y
Y Combinator Blog
IT之家
IT之家
Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
SegmentFault 最新的问题
腾讯CDC
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
罗磊的独立博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
G
Google Developers Blog
Microsoft Azure Blog
Microsoft Azure Blog
The Register - Security
The Register - Security
博客园 - 司徒正美
N
Netflix TechBlog - Medium
S
Schneier on Security
博客园 - 聂微东
U
Unit 42
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
雷峰网
雷峰网
Latest news
Latest news

博客园 - ®Geovin Du Dream Park™

go: Functional Options Pattern go:Timing Functions Pattern python: Timing Functions Pattern go: Steady-State Pattern python: Steady-State Pattern go: Handshaking Pattern python: Handshaking Pattern go: Fail-Fast Pattern python: Fail-Fast Pattern I go: Deadline Pattern python: Deadline Pattern go: Circuit-Breaker Pattern python: Circuit-Breaker Pattern go: Bulkheads Pattern python: Bulkheads Pattern go: Push & Pull Pattern python: Push & Pull Pattern python: Publish/Subscribe Pattern II go: Publish/Subscribe Pattern python: Publish/Subscribe Pattern go: Futures & Promises Pattern python: Futures & Promises Pattern go: Worker Pool Pattern go:Pipeline Pattern python: Worker Pool Pattern python: Pipeline Pattern go: Fan-Out Pattern python: Fan-Out Pattern go: Fan-In Pattern python: Fan-In Pattern Fan-In go: Producer Consumer  Pattern python: Producer Consumer Pattern go: Parallelism Pattern python: Parallelism Pattern go: Reactor Pattern python: Reactor Pattern go: Generators Pattern python: speech to text offline python: Generators Pattern go: Coroutines Pattern python:Coroutines Pattern go: Broadcast Pattern python: Broadcast Pattern python: Bounded Parallelism Pattern go: Bounded Parallelism Pattern python: N-Barrier Pattern go: N-Barrier Pattern python: Semaphore Pattern go: Semaphore Pattern python: Read-Write Lock Pattern go: Read-Write Lock Pattern python: Monitor Pattern go: Monitor Pattern python: Mutex Pattern go: Lock/Mutex Pattern Python: Condition Variable Pattern go:Condition Variable Pattern python: Registry Pattern python: Interpreter Pattern go: Interpreter Pattern go: Registry Pattern go: Memento Pattern go: Command Pattern go: State Pattern go:Template Method Pattern go: Strategy Pattern go: Visitor Pattern go: Observer Pattern go: Mediator Pattern go: Iterator Pattern go: Chain of Responsibility Pattern go: Proxy Pattern go:Decorator Pattern go: Facade Pattern go: Flyweight Pattern go: Composite Pattern go: Singleton Pattern go: Prototype Pattern go: Bridge Pattern go: Adapter Pattern go: Builder Pattern 密码进行加盐哈希 using CSharp,Python,Go,Java go: Abstract Factory Pattern go: Model,Interface,DAL ,Factory,BLL using mysql go: Simple Factory Pattern go: Factory Method Pattern go: goLang 在Windows环境搭建Go语言开发环境 CSharp: Parallel Extensions python: 蝴蝶跟随鼠标 javascript: 中国历史人物热力分布图using echart javascript: 中国历史人物热力图 python: 初养龙虾微信纯文字自动回复using workBuddy python: object 入门 python: Factory Method Pattern python: Simple Factory Pattern python: Abstract Factory Pattern 区域化 代码 python: Null Object Pattern python: Builder Pattern python: Adapter Pattern
cpp: class
®Geovin Du Dream Park™ · 2026-03-29 · via 博客园 - ®Geovin Du Dream Park™
#include <iostream>
#include <string>
using namespace std;

class teacher {
    // 私有成员变量
    string name;
    float salary;  // 月薪
    float money;   // 奖金
    string date;   // 入职日期

public:
    // 无参构造函数
    teacher() {
        name = "unknown";
        salary = 0;
        money = 0;
        date = "0";
    }

    // 带参构造函数(已修复!)
    teacher(string n, float s, float m, string d) {
        name = n;    // 正确赋值
        salary = s;
        money = m;
        date = d;
    }

    // 输入信息
    void input() {
        cout << "请输入姓名:";
        cin >> name;
        cout << "请输入月薪:";
        cin >> salary;
        cout << "请输入奖金:";
        cin >> money;
        cout << "请输入入职日期:";
        cin >> date;
    }

    // 计算月总收入
    float cmonth() {
        return salary + money;
    }

    // 计算年薪(修复:添加return)
    float cyear() {
        return cmonth() * 12;
    }

    // 显示所有信息(修复:完整输出)
    void disp() {
        cout << "\n===== 教师信息 =====" << endl;
        cout << "姓名:" << name << endl;
        cout << "入职日期:" << date << endl;
        cout << "月薪:" << salary << endl;
        cout << "奖金:" << money << endl;
        cout << "月总收入:" << cmonth() << endl;
        cout << "年薪:" << cyear() << endl;
        cout << "====================\n" << endl;
    }
};

// 主函数(修复逻辑)
int main() {
    teacher t;
    int a;

    while (true) {  // 更清晰的循环
        cout << "退出请按 1,继续输入请按 2:";
        cin >> a;

        if (a == 1) {
            cout << "已退出程序" << endl;
            break;
        }

        if (a == 2) {
            t.input();   // 输入
            t.disp();    // 显示
        }
    }
    return 0;
}
#include <iostream>
#include <cstdint>   // C++20 固定宽度整数类型
#include <stdexcept> // 异常处理

// C++20 constexpr:允许编译期计算阿克曼函数
// uint64_t:64位无符号整数,防止数值溢出
constexpr uint64_t ackermann(uint64_t m, uint64_t n)
{
    // 限制输入范围,避免栈溢出/计算爆炸
    if (m > 4) {
        throw std::invalid_argument("m 不能大于 4,否则计算量极大且会栈溢出!");
    }

    // 阿克曼函数标准定义
    if (m == 0) {
        return n + 1;
    }
    else if (n == 0) {
        return ackermann(m - 1, 1);
    }
    else {
        return ackermann(m - 1, ackermann(m, n - 1));
    }
}

int main()
{
    try {
        std::cout << "=== C++20 阿克曼函数演示 ===" << std::endl;

        // 编译期计算(C++20 新特性)
        constexpr auto a0 = ackermann(0, 5);
        constexpr auto a1 = ackermann(1, 5);
        constexpr auto a2 = ackermann(2, 3);
        constexpr auto a3 = ackermann(3, 4);

        std::cout << "ackermann(0, 5) = " << a0 << '\n';
        std::cout << "ackermann(1, 5) = " << a1 << '\n';
        std::cout << "ackermann(2, 3) = " << a2 << '\n';
        std::cout << "ackermann(3, 4) = " << a3 << '\n';

        // 注意:ackermann(4, 1) 已经非常大
        // ackermann(4, 2) 数值巨大,计算极慢
    }
    catch (const std::exception& e) {
        std::cerr << "错误:" << e.what() << '\n';
        return 1;
    }

    return 0;
}

https://github.com/TheAlgorithms
Professional Parallel Programming with C#: Master Parallel Extensions with .NET 4
https://www.wiley.com/en-us/Professional+Parallel+Programming+with+C%23%3A+Master+Parallel+Extensions+with+.NET+4-p-9780470495995#downloadstab-section

https://github.com/shtigran/Async-Programming
https://github.com/ltd-ARYAN-pvt/Introduction-to-Parallel-Processing-and-Asynchronous-Programming
https://github.com/SaladinoBelisario/Parallel-And-Asynchronous-Java
https://github.com/thanhit95/multi-threading
https://github.com/SalehAhmadi/parallel-programming-csharp
https://github.com/PacktPublishing/Asynchronous-Programming-with-CPP
https://github.com/djeada/Parallel-and-Concurrent-Programming
https://github.com/raymondino/Csharp-multithreading
https://github.com/Alejoho/Tutorial-of-Multithreading-Asynchronous-Programming-in-CSharp-NET-8-2024-Parallel-Programming
https://github.com/zahi1/Concurrent-Programming
https://github.com/PacktPublishing/Mastering-Concurrency-in-Python
https://github.com/jeremybytes/async-workshop-2024

哲学管理(学)人生, 文学艺术生活, 自动(计算机学)物理(学)工作, 生物(学)化学逆境, 历史(学)测绘(学)时间, 经济(学)数学金钱(理财), 心理(学)医学情绪, 诗词美容情感, 美学建筑(学)家园, 解构建构(分析)整合学习, 智商情商(IQ、EQ)运筹(学)生存.---Geovin Du(涂聚文)