C语言程序设计Day2
#include <stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
int c=a/100;
int d=a%100;
int e=c*60+d;
int time=b+e;
int time1=time/60;
int time2=time%60;
int time3=time1*100+time2;
printf("%d",time3);
return 0;
}
问题:时间的转化 1120转化为分钟数
#include <stdio.h>
int main()
{
int a;
scanf("%d",&a);
int b=a/100;
int c=a%100;
int d=c/10;
int e=c%10;
int i=e*100+d*10+b;
printf("%d",i) ;
return 0;
}
问题:注意如何使0不存在