Skip to content

Instantly share code, notes, and snippets.

@whs
Created September 15, 2011 15:23
Show Gist options
  • Select an option

  • Save whs/1219543 to your computer and use it in GitHub Desktop.

Select an option

Save whs/1219543 to your computer and use it in GitHub Desktop.
Grader
#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;
}
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