单行if语句
#include<iostream>
using namespace std;
int main() {
int score = 0;
cout << "请输入一个分数" << endl;
cin >> score;
cout << "您的分数为:" << score << endl;
if (score > 600)
{
cout << "恭喜您考上一本大学!!" << endl;
}
system("pause");
return 0;
}
多行if语句
#include<iostream>
using namespace std;
int main() {
int score = 0;
cout << "请输入你的分数" << endl;
cin >> score;
cout << "你输入的分数是:" << score << endl;
if (score > 600)
{
cout << "恭喜您考上一本大学" << endl;
}
else
{
cout << "未考上一本大学" << endl;
}
system("pause");
return 0;
}
多条件if语句
#include<iostream>
using namespace std;
int main() {