Answers for "Uri/Beecrowd Problem no - 1184 solution in C"

C
0

Uri/Beecrowd Problem no - 1184 solution in C

#include<stdio.h>
int main(){
    double M[12][12],sum = 0;
    int i,j,counter = 1;
    char O[2];
    scanf("%s", O);
    
    for(i = 0; i < 12; i++){
        for(j = 0; j < 12; j++){
            scanf("%lf", &M[i][j]);
        }
    }
    for(i = counter; i < 12; i++){
        for(j = 0; j < counter; j++){
            sum += M[i][j];
        }
        counter++;
    }
    if(O[0] == 'S'){
        printf("%.1lf\n", sum);
    }else if(O[0] == 'M'){
        printf("%.1lf\n", sum / 66.0);
    }
    return 0;
}
Posted by: Guest on February-28-2022

Code answers related to "Uri/Beecrowd Problem no - 1184 solution in C"

Code answers related to "C"

Browse Popular Code Answers by Language