[Codeforces Round #156 (Div. 2)]A. Greg's Workout

地址:http://codeforces.com/contest/255/problem/A

三种运动,循环锻炼,看哪一种锻炼的最多

 1 #include<stdio.h>
 2 #include<stdlib.h>
 3 
 4 int n,e[3];
 5 char a[3][9]={"chest\0","biceps\0","back\0"};
 6 
 7 int main()
 8 {
 9     int i,in,max=0,ans=0;
10     scanf("%d",&n);
11     for(i=0;i<n;i++)
12     {
13         scanf("%d",&in);
14         e[i%3]+=in;
15     }
16     for(i=0;i<3;i++)
17     {
18         if(e[i]>ans)
19         {
20             max=i;
21             ans=e[i];
22         }
23     }
24     printf("%s\n",a[max]);
25     return 0;
26 }

 

posted @ 2013-01-17 14:54  tjsuhst  阅读(172)  评论(0)    收藏  举报