Created
July 11, 2016 21:24
-
-
Save KhaledElshamy/9e3eced1af2beb33959526a0bfbb0f19 to your computer and use it in GitHub Desktop.
URI ONLINRE JUDGE problem 1183
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define Num_column 12 | |
#define Num_row 12 | |
int main() | |
{ | |
//URI ONLINRE JUDGE problem 1183 | |
double b[Num_row][Num_column],*p,sum = 0.0; | |
int i, j; | |
char c; | |
scanf("%c",&c); | |
for (i = 0;i < 12;i++) | |
{ | |
for (j = 0;j < 12;j++) | |
{ | |
scanf("%lf", &b[i][j]); | |
if (j > i) | |
sum += b[i][j]; | |
} | |
} | |
if (c == 'S') | |
printf("%.1lf\n", sum); | |
else | |
printf("%.1lf\n", sum / 66); | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment