Nerde Nolzda

ZeroJudge: a053 Sagit's 計分程式

ZeroJudge Link (Zh)

#include <stdio.h>
#include <math.h>

main() {
  int num, res;
  while (scanf("%d", &num) != EOF) {
    if (num >= 40) res = 100;
    else if (num > 20) res = 80 + (num - 20);
    else if (num > 10) res = 60 + (num - 10) * 2;
    else res = num * 6;
    printf("%d\n", res);
  }
  return 0;
}

Related Posts

0 comments

Post a comment

Send an email to comment@nerde.pw.