课堂小练习

来源:互联网 发布:input type js修改 编辑:程序博客网 时间:2024/06/02 20:12
#include<iostream>
using namespace std;
int main()
{
float x;//
while (0)
{
cout << "录入分数:";
cin >> x;
cout.precision(0);//
cout << fixed; 
cout << x << endl;
cout << "等第为";
if (x >= 90 && x<=100) cout << "A"<< endl;
else if (x >= 75 && x < 90) cout << "B" << endl; 
else if (x >= 60 && x < 75) cout << "C" << endl;
else if (x < 60 && x >= 0) cout << "D\n";
else cout << "无效值,请重新录入" << endl;
system("pause");
}
return 0;
}