Skip to content

Instantly share code, notes, and snippets.

@pinglunliao
Last active November 5, 2019 08:38
Show Gist options
  • Save pinglunliao/a40a9662413c2e6b7afc to your computer and use it in GitHub Desktop.
Save pinglunliao/a40a9662413c2e6b7afc to your computer and use it in GitHub Desktop.
a053: Sagit's 計分程式 FYI: https://yunlinsong.blogspot.com/2016/02/sagit.html
#include <iostream>
using namespace std;
int main() {
int n;
int s;
while(cin >> n)
{
if(n <= 10)
{
s = 6 * n;
}
else if(n <= 20)
{
s = 60 + 2 * (n-10);
}
else if(n <= 40)
{
s = 80 + n - 20;
}
else
{
s = 100;
}
cout << s << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment