首页 > 其他 > 详细

pat_1

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

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!