Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- char stu[110][30];
- int n;
- int sch[110];
- int main() {
- int i, k, t;
- scanf("%d", &n);
- for (i = 0; i < n; i++) {
- scanf("%s %d %d %c %c %d", stu[i] + 5, &stu[i][0], &stu[i][1], &stu[i][2], &stu[i][3], &t);
- stu[i][4] = t + 1;
- }
- for (i = 0; i < n; i++) {
- if (stu[i][0] > 80 && stu[i][4] > 1) sch[i] += 8000;
- if (stu[i][0] > 85 && stu[i][1] > 80) sch[i] += 4000;
- if (stu[i][0] > 90) sch[i] += 2000;
- if (stu[i][0] > 85 && stu[i][3] == 'Y') sch[i] += 1000;
- if (stu[i][1] > 80 && stu[i][2] == 'Y') sch[i] += 850;
- }
- k = 0;
- for (i = 1; i < n; i++)
- if (sch[i] > sch[k])
- k = i;
- printf("%s\n%d\n", stu[k] + 5, sch[k]);
- for (i = 0, k = 0; i < n; i++)
- k += sch[i];
- printf("%d\n", k);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement