Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
5381 | 邓小龙 | 时间换算 | C++ | Wrong Answer | 0 MS | 264 KB | 533 | 2024-11-14 19:55:43 |
#include<iostream> // cin\cout\endl #include<cstdio>//scanf,printf using namespace std; //思路:1.录入秒数,定义一个存秒数的变量int s //2.秒转小时公式:s/3600=h //3.小时转天数公式:h/24=d //4.天转周:d/7=w int main(){ int s;//秒数 double h,d,w; cin>>s;//录入秒数 //求h,d,w h=s*1.0/3600;//s整数,3600也是整数 //cout<<h<<endl; d=h/24;//求天数 w=d/7;//求周数 printf("%.2lfhour\n%.2lfday\n%.2lfweek\n",h,d,w); return 0; }
------Input------
963852741
------Answer-----
4.11hour 0.17day 0.02week
------Your output-----
267736.87hour 11155.70day 1593.67week