解题思路:
用string数组存储字符串
注意事项:
参考代码:
#include <iostream>
#include <deque>
#include <algorithm>
#include <numeric>
#include <iterator>
#include <string>
#include <cmath>
#include <cstdlib>
#include <string.h>
using namespace std;
int main()
{
string str[1001];
int n,i=0;
while(cin>>n)
{
if(n<=100&&n>=90)
{
str[i]="A";
}
else if(n>=80&&n<90)
{
str[i]="B";
}
else if(n>=70&&n<80)
{
str[i]="C";
}
else if(n>=60&&n<70)
{
str[i]="D";
}
else if(n>=0&&n<60)
{
str[i]="E";
}
else
{
str[i]="Score is error!";
}
i++;
}
for(int j=0;j<i;j++)
{
cout<<str[j]<<endl;
}
return 0;
}
0.0分
0 人评分
C二级辅导-同因查找 (C语言代码)浏览:662 |
简单的a+b (C语言代码)浏览:643 |
【亲和数】 (C语言代码)浏览:493 |
回文串 (C语言代码)浏览:2856 |
C语言程序设计教程(第三版)课后习题6.3 (C语言代码)浏览:660 |
核桃的数量 (C语言代码)浏览:669 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:794 |
C语言训练-亲密数 (C语言描述,反正怎么都能对)浏览:2165 |
2005年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:574 |
2006年春浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:661 |