Created
July 11, 2016 21:22
-
-
Save KhaledElshamy/4b92bc85062c4eb00a7dad0c34bd4eac to your computer and use it in GitHub Desktop.
URI ONLINE JUDGE Problem 1181
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> | |
int main() { | |
//URI ONLINE JUDGE Problem 1181 | |
char a; | |
int i, j, f; | |
float s = 0.0, n; | |
scanf("%d ", &f); | |
scanf("%c", &a); | |
for (i = 0; i < 112; i++) { | |
for (j = 0; j < 12; j++) { | |
scanf("%f", &n); | |
if (i == f) s += n; | |
} | |
} | |
if (a == 'S') printf("%.1f\n", s); | |
else printf("%.1f\n", s / 12); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment