2551=检查宿舍卫生

 1 #include <stdio.h>
 2 #include <stdlib.h>
 3 struct node
 4 {
 5     int date;//结构体。
 6 } a[100];
 7 int main()
 8 {
 9     int n,cnt;
10     int b,c,d,e,f,g,i,max=0;
11     while(~scanf("%d",&n))
12     {
13         cnt=0;
14         max=0;
15         for(i=0; i<n; i++)
16         {
17             scanf("%d %d %d %d %d",&b,&c,&d,&e,&f);
18             a[i].date=(b+c+d+e+f);
19             if(a[i].date<85)cnt++;
20             if(a[i].date>=max)max=a[i].date;
21         }
22         if(max<85)printf("%d No
",cnt);//注意看题意,错了好几次。
23         else printf("%d %d
",cnt,max);
24     }
25     return 0;
26 }
原文地址:https://www.cnblogs.com/Angfe/p/10435633.html