- 谁拿了最多奖学金
- 2017-03-18 11:34:46 @
#include <iostream>
#include <string>
using namespace std;
int main()
{
struct studentstruct
{
string name;
int examp;
int classp;
char manager;
char west;
int lunwen;
int money;
string highestn;
int highestm;
int moneys;
}student;
int a;
cin>>a;
for(int i=0;i!=a;i++)
{
student.money=0;
cin>>student.name>>student.examp>>student.classp>>student.manager>>student.west>>student.lunwen;
if (student.examp>80&&student.lunwen>=1)
student.money+=8000;
if (student.examp>85&&student.classp>=80)
student.money+=4000;
if (student.examp>90)
student.money+=2000;
if (student.examp>85&&student.west=='Y')
student.money+=1000;
if (student.classp>80&&student.manager=='Y')
student.money+=850;
if (student.money>student.highestm)
{
student.highestm=student.money;
student.highestn=student.name;
}
student.moneys+=student.money;
}
cout<<student.highestn<<endl;
cout<<student.highestm<<endl;
cout<<student.moneys<<endl;
return 0;
}
在自己的电脑上都没有问题
1 条评论
-
MC清理大师 LV 4 @ 2017-03-18 16:05:17
dddd
- 1