山东科技大学OJ//几分几秒山东科技大学OJ//几分几秒

 这题的解题方法和计算多少秒就是一个相反的过程,可以先减1再相除3600与60.


#include<stdio.h>
int main()
{
    int a,b,c,n;
    while(scanf("%d",&n)!=EOF)
   {
       if(n==0) break;
       a=(n-1)/3600;
    b=(n-a*3600-1)/60;
    c=n-a*3600-b*60-1;
 
        printf("%.2d:%.2d:%.2d\n",(n-1)/3600,b,c);
   }
}

 

相关文章:

  • 2021-08-26
  • 2022-01-27
  • 2022-12-23
  • 2022-01-26
  • 2022-12-23
  • 2021-12-24
  • 2022-12-23
  • 2022-01-15
猜你喜欢
  • 2021-10-09
  • 2021-09-18
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2021-12-05
相关资源
相似解决方案