#include<stdio.h> #include<stdlib.h> struct S { char name[20]; int score; int total; char leader; char west; int paper; }; int main(void) { int n; scanf("%d", &n); S* s = (S*)malloc(sizeof(S) * (n+1)); long long int total = 0, max = 0, index = 0; for (int i = 1; i <= n; i++) { long long int award = 0; scanf("%s %d %d %c %c %d", s[i].name, &s[i].score, &s[i].total, &s[i].leader, &s[i].west, &s[i].paper); if (s[i].score > 80 && s[i].paper >=1) award += 8000; if (s[i].score > 85 && s[i].total > 80) award += 4000; if (s[i].score > 90) award += 2000; if (s[i].score > 85 && s[i].west == 'Y') award += 1000; if (s[i].total > 80 && s[i].leader == 'Y') award += 850; total += award; if (award > max) { index = i; max = award; } } printf("%s\n%lld\n%lld", s[index].name, max, total); free(s); return 0; }
0.0分
1 人评分
大神老白 (C语言代码)浏览:637 |
C语言程序设计教程(第三版)课后习题12.1 (C语言代码)浏览:689 |
C语言程序设计教程(第三版)课后习题12.3 (C语言代码)浏览:587 |
C语言程序设计教程(第三版)课后习题8.4 (C语言代码)浏览:607 |
简单的a+b (C语言代码)浏览:531 |
求圆的面积 (C语言代码)浏览:714 |
C语言程序设计教程(第三版)课后习题6.5 (C语言代码)浏览:648 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:596 |
P1001 (Java代码)浏览:740 |
循环链表与单个结点删除浏览:1115 |