Created
December 18, 2012 15:02
-
-
Save coderaven/4328756 to your computer and use it in GitHub Desktop.
ICTS Programming Competition Solution for Problem A
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> | |
#include <string.h> | |
int main(){ | |
char speeds[100], *splice; | |
int curr_speed,i; | |
fgets(speeds,100,stdin); | |
splice = strtok(speeds," "); | |
for(i = 1; splice != NULL; i++){ | |
curr_speed = atoi(splice); | |
printf("Case %d: ",i); | |
if (curr_speed >= 30 && curr_speed <= 46) printf("Tropical depression\n"); | |
else if (curr_speed >= 47 && curr_speed <= 89) printf("Tropical storm\n"); | |
else if (curr_speed >= 90 && curr_speed <= 183) printf("Typhoon\n"); | |
else if (curr_speed > 183) printf("Super typhoon\n"); | |
else printf("No classification\n"); | |
splice = strtok(NULL," "); | |
} | |
getch(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment