《quantitative finance with cpp》阅读笔记5---cpp根据不同考试成绩输出不同字符
作者:yunjinqi 类别:
日期:2023-11-24 11:07:41
阅读:553 次 消耗积分: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;
}