Created
September 15, 2011 15:23
-
-
Save whs/1219543 to your computer and use it in GitHub Desktop.
Grader
This file contains hidden or 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 score; | |
| int main(void){ | |
| printf("Your score: "); | |
| scanf("%d", &score); | |
| if(score>100){ | |
| printf("You cheat!"); | |
| }else{ | |
| if(score>79){ | |
| printf("Grade 4"); | |
| }else{ | |
| if(score>69){ | |
| printf("Grade 3"); | |
| }else{ | |
| if(score>59){ | |
| printf("Grade 2"); | |
| }else{ | |
| if(score>49){ | |
| printf("Grade 1"); | |
| }else{ | |
| printf("Grade 0"); | |
| } | |
| } | |
| } | |
| } | |
| } | |
| return 0; | |
| } |
This file contains hidden or 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
| score=input("Your score: "); | |
| if score>100: | |
| print "You cheat!"; | |
| else: | |
| if score>79: | |
| print "Grade 4"; | |
| else: | |
| if score>69: | |
| print "Grade 3"; | |
| else: | |
| if score>59: | |
| print "Grade 2"; | |
| else: | |
| if score>49: | |
| print "Grade 1"; | |
| else: | |
| print "Grade 0"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment