技巧:
1.round函数的使用(注意括号里是double)
2.%02d的使用
#include<math.h>
#include<stdio.h>
int main(){
int a,b;
scanf("%d%d",&a,&b);
int c,d,f,time;
time=round((b-a)*1.0/100);
c=time/3600;
d=time/60%60;
f=time%60;
printf("%02d:%02d:%02d",c,d,f);
return 0;
}
最后
以上就是欣慰篮球最近收集整理的关于PAT乙级C语言 1026 程序运行时间的全部内容,更多相关PAT乙级C语言内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复