Skip to content

Instantly share code, notes, and snippets.

@TheoKlein
Created September 19, 2015 11:22
Show Gist options
  • Select an option

  • Save TheoKlein/365ca50bfc8b223c3d1d to your computer and use it in GitHub Desktop.

Select an option

Save TheoKlein/365ca50bfc8b223c3d1d to your computer and use it in GitHub Desktop.
ZeroJudge a053
#include <stdio.h>
int main() {
int n,score;
while (scanf ("%d",&n) != EOF){
if (n >=0 && n <= 10){
score = n * 6;
printf ("%d\n",score);
}else if (n >= 11 && n <= 20){
score = (n-10) * 2 + 60;
printf ("%d\n",score);
}else if (n >= 21 && n <= 40){
score = (n - 20) + 80;
printf ("%d\n",score);
}else if (n > 40){
score = 100;
printf ("%d\n",score);
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment