- 谁拿了最多奖学金
- 2016-12-03 16:31:44 @
#include<cstdio>
int n,s[101],k,h,sum;
struct node
{
char name[20];
int end;
int often;
char job;
char west;
int a;
}f[101];
int main()
{
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%s %d %d %c %c %d",f[i].name,&f[i].end,&f[i].often,&f[i].job,&f[i].west,&f[i].a);
if(f[i].end>80&&f[i].a>=1) s[i]+=8000;
if(f[i].end>85&&f[i].often>80) s[i]+=4000;
if(f[i].end>90) s[i]+=2000;
if(f[i].end>85&&f[i].west=='Y') s[i]+=1000;
if(f[i].often>80&&f[i].job=='Y') s[i]+=850;
sum+=s[i];
if(s[i]>k)
{
k=s[i];h=i;
}
}
puts(f[h].name);
printf("%d\n%d",s[h],sum);
}
1 条评论
-
曹家好牛 LV 6 @ 2016-12-03 16:32:10
include<cstdio>
int n,s[101],k,h,sum;
struct node
{
char name[20];
int end;
int often;
char job;
char west;
int a;
}f[101];
int main()
{
scanf("%d",&n);
for(int i=0;i<n;i++) { scanf("%s %d %d %c %c %d",f[i].name,&f[i].end,&f[i].often,&f[i].job,&f[i].west,&f[i].a); if(f[i].end>80&&f[i].a>=1) s[i]+=8000;
if(f[i].end>85&&f[i].often>80) s[i]+=4000;
if(f[i].end>90) s[i]+=2000;
if(f[i].end>85&&f[i].west=='Y') s[i]+=1000;
if(f[i].often>80&&f[i].job=='Y') s[i]+=850;
sum+=s[i];
if(s[i]>k)
{
k=s[i];h=i;
}
}
puts(f[h].name);
printf("%d\n%d",s[h],sum);
}
- 1