Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Problem URI 1185
- //https://www.urionlinejudge.com.br/judge/en/problems/view/1185
- #include<stdio.h>
- int main()
- {
- char S;
- double M[12][12],sum=0,avg=0;
- int i,j,n=11;
- scanf("%c",&S);
- for(i=0;i<12;i++)
- {
- for(j=0;j<12;j++)
- {
- scanf("%lf",&M[i][j]);
- }
- }
- for(i=0;i<12;i++)
- {
- for(j=0;j<n;j++,n--)
- sum+=M[i][j] ;
- }
- if(S=='S'){printf("%.1lf\n",sum);}
- else if(S=='M'){
- avg=sum/66.0;
- printf("%.1lf\n",avg);}
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement