Last active
August 29, 2015 14:23
-
-
Save raryosu/fcb02a4e692dac819e08 to your computer and use it in GitHub Desktop.
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() { | |
int m, f, r; | |
while(1) { | |
/* 各データセットの読み込み */ | |
scanf("%d %d %d", &m, &f, &r); | |
if(m==-1 && f==-1 && r==-1) { | |
break; | |
} else if(m==-1 || f==-1) { /* 成績がFの時 */ | |
printf("F\n"); | |
} else if(m+f >= 80){ /* 成績がAの時 */ | |
printf("A\n"); | |
} else if(m+f >= 65){ /* 成績がBの時 */ | |
printf("B\n"); | |
} else if(m+f >= 50){ /* 成績がCの時(1) */ | |
printf("C\n"); | |
} else if(m+f >= 30 && r >= 50){ /* 成績がCの時(2) */ | |
printf("C\n"); | |
} else if(m+f >= 30 && r < 50){ /* 成績がDの時 */ | |
printf("D\n"); | |
} else { /* その他の時 = 成績がFの時 */ | |
printf("F\n"); | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment