码迷,mamicode.com
首页 > 其他好文 > 详细

oj--dashuju

时间:2017-06-05 22:12:10      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:turn   span   das   ==   print   sum   return   eof   color   

 

1.

#include<cstdio>
int main(){
    int k;
    char t;
    int sum=0;
    while(scanf("%d %c",&k,&t)!=EOF){
        sum=0;
        if(k<=1000) sum+=8;
        if(k>1000) {
            int temp=k-1000;
            int a;
            if(k%500==0)a=temp/500;
            else a =temp/500+1;
            sum=8+a*4;
        }
        if(t==y) sum+=5;
        printf("%d",sum);
    }
    return 0;
}



    

 

oj--dashuju

标签:turn   span   das   ==   print   sum   return   eof   color   

原文地址:http://www.cnblogs.com/kprac/p/6947016.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!