[ZJ]a053: Sagit's 計分程式
題目:
http://zerojudge.tw/ShowProblem?problemid=a053
-------------------------------------------------------------------------------------------------
#include<stdio.h>
#include<stdlib.h>
int main()
{
int in0 ,out ;
while (scanf("%d",&in0)!=EOF){
if (in0 >=40)
out=100 ;
else if (in0 >20)
out =80 +(in0 -20) *1 ;
else if (in0 >10)
out =60 +(in0 -10) *2 ;
else
out =in0 *6 ;
printf("%d \n",out);
}
return 0;
}
http://zerojudge.tw/ShowProblem?problemid=a053
-------------------------------------------------------------------------------------------------
#include<stdio.h>
#include<stdlib.h>
int main()
{
int in0 ,out ;
while (scanf("%d",&in0)!=EOF){
if (in0 >=40)
out=100 ;
else if (in0 >20)
out =80 +(in0 -20) *1 ;
else if (in0 >10)
out =60 +(in0 -10) *2 ;
else
out =in0 *6 ;
printf("%d \n",out);
}
return 0;
}
留言
張貼留言