《quantitative finance with cpp》阅读笔记5---cpp根据不同考试成绩输出不同字符
作者:yunjinqi   类别:    日期:2023-11-24 11:07:41    阅读:158 次   消耗积分:0 分    
#include <iostream>
#include <cmath>
using namespace std;
 
int main() {
 
    int mark;
    cout << "What was your average mark?\n";
    cin >> mark;
 
    if (mark >= 70) {
        cout << "Congratulations!\n";
        cout << "You got a distinction.\n";
    }
    else if (mark >= 60) {
        cout << "Well done!\n";
        cout << "You got a merit!\n";
    }
    else if (mark >= 50) {
        cout << "You passed.\n";
    }
    else {
        cout << "You failed :-(\n";
    }
    return 0;
}


版权所有,转载本站文章请注明出处:云子量化, http://www.woniunote.com/article/370
上一篇:《quantitative finance with cpp》阅读笔记4---一个用cpp计算银行存款利息的例子
下一篇:《quantitative finance with cpp》阅读笔记6---计算公司的净利润