Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main(){
- int f,k,i,j,y,soma = 0,x[12][12];
- char o;
- scanf("%d", &y);
- scanf("%s", &o);
- for(i=0;i<12;i++){
- for(j=0;j<12;j++){
- scanf("%d", &x[i][j]);
- }
- }
- if(strcmp(o,"S") == 0){
- for(k=0 ; k<12 ; k++){
- soma += x[y][k];
- }
- printf("%d\n", soma);
- }
- if(strcmp(o,"M") == 0){
- for(f=0 ;f<12 ; f++){
- soma += x[y][i];
- }
- printf("%d\n", soma/12);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement