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

pat_1

时间:2014-07-14 19:49:18      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   os   art   

2-0

 

2-1

bubuko.com,布布扣
#include <stdio.h>

int main()  
{
    int inch,foot,cm;
    scanf("%d",&cm);
    foot=cm/30.48;
    inch=cm*12/30.48-foot*12;
    printf("%d %d\n",foot,inch);
    return 0;
}
View Code

 

2-2

bubuko.com,布布扣
#include <stdio.h>
int main()  
{
    int h,min,time;
    int tmp;
    scanf("%d%d",&tmp,&time);
    h=tmp/100;
    min=tmp%100;
    min+=time%60;
    if(min>=60)
    {
        h+=min/60;
        min=min%60;
    }
    if(min<0)
    {
        h-=1;
        min+=60;
    }
    h+=time/60;
    printf("%d%02d\n",h,min);

    return 0;
}
View Code

 

2-3

bubuko.com,布布扣
#include <stdio.h>
int main()  
{
    int tmp;
    int a,b,c;
    scanf("%d",&tmp);
    c=tmp%10;
    b=tmp/10%10;
    a=tmp/100;
    if(c!=0)
    {
        printf("%d%d%d",c,b,a);return 0;
    }
    if(b!=0)
    {
        printf("%d%d",b,a);return 0;
    }
    printf("%d\n",a);
    return 0;
}
View Code

 

pat_1,布布扣,bubuko.com

pat_1

标签:style   blog   http   color   os   art   

原文地址:http://www.cnblogs.com/xiaowangzi2013/p/3842737.html

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