- 谁拿了最多奖学金
- 2017-05-04 22:33:07 @
#include <iostream>
#include <string>
using namespace std;
int main()
{
string name, Mname;
int grade,Cgrade ,ms, N, money = 0, result = 0, sum = 0;
char gb,xb;
cin >> N;
for (int i = 1; i <= N; i++)
{
cin >> name >> grade >> Cgrade >> gb >> xb >> ms;
if (grade>80 && ms >= 1)
money+=8000;
if (grade > 85 && Cgrade > 80)
money+=4000;
if (grade > 90)
money+=2000;
if (grade > 85 && xb == 'Y')
money+=1000;
if (Cgrade > 80 && gb == 'Y')
money+=850;
sum+=money;
if (result < money)
{
result = money;
Mname = name;
}
}
cout << Mname << endl << result << endl << sum << endl;
system("pause");
return 0;
}
1 条评论
-
贱人在我右边 LV 9 @ 2017-05-06 15:36:07
最后这个system(pause)……
- 1