#include <stdio.h> int main() { int h=0,m=0,s=0,t; scanf("%d",&t); while (t >= 3600){ h++; t-=3600; } while (t >= 60){ m++; t-=60; } while (t >= 1){ s++; t-=1; } printf("%d:%d:%d",h,m,s); return 0; } 暴解一下呗,没问题(o´ω`o)و
#include<stdio.h> int main() { int i,h,m,s; scanf("%d",&i); if(i<0&&i>86399) printf("eorr!"); h=i/3600; m=(i%3600)/60; s=((i%3600)%60); printf("%d:%d:%d",h,m,s); }
#include<stdio.h> int main() { int t; int H=0,M=0,S=0; scanf("%d",&t); if(t<0 || t>86399){ return 0; } S = t%60; M = t/60; H = M/60; M = M-(H*60); printf("%d:%d:%d\n",H,M,S); return 0; }
请问这个为什么编译错误 求解答 谢谢! #include<stdio.h> int main(){ int x,m,h,s; scanf("%d",&x); if(0<=x<=86399){ h=x/3600; m=(x-h*3600)/60; s=x%60; printf("%d:%d:%d",h,m,s); } return 0; }
C语言程序设计教程(第三版)课后习题9.8 (C语言代码)浏览:524 |
C二级辅导-进制转换 (C语言代码)浏览:514 |
高精度加法 (C++代码)(大数加法)浏览:916 |
蓝桥杯历届试题-九宫重排 (C++代码)浏览:2782 |
这可能是一个假的冒泡法浏览:985 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:528 |
C语言程序设计教程(第三版)课后习题8.1 (C语言代码)浏览:517 |
【排队买票】 (C语言代码)浏览:899 |
2004年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:500 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:695 |