Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- int main()
- {
- double M[12][12], total = 0;
- int i = 0, j = 0, y;
- char x;
- scanf("%d %c", &y, &x);
- for(int i=0; i<12; i++)
- for(int j=0; j<12; j++)
- scanf("%d", &M[i][j]);
- j = 0;
- if(x == 'S'){
- i = y;
- while(j < 12){
- total = total + M[i][j];
- j++;
- }
- printf("%.1lf\n", total);
- }else if(x == 'M'){
- while(j < 12){
- total = total + M[i][j];
- j++;
- }
- total = total/12;
- printf("%.1lf\n", total);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement