tyvj begin 闰秒 wa了2个小时竟然 【水题】
2014-08-01 08:03
190 查看
背景 Background Unit 2, Section D 描述 Description 对于给定的秒数,请输出它以时:分:秒的形式的表 示。 当然,为了增加难度,我们假设每一分钟都有闰秒, 也就是说一分钟有61秒。 输入格式 InputFormat 输入一行,一个整数,表示秒数(0<n<5000)。 输出格式 OutputFormat 输出一行,以时:分:秒的形式的表示。
我的wa点就是它的分是61秒,可是到小时就又变为60进1了。
<span style="font-size:14px;">#include <iostream> using namespace std; int main() { int s,h,m; cin>>s; if(s<61) { if(s<10&&s>0)cout << "00:00:0" <<s<< endl; else if(s>=10)cout<<"00:00:"<<s<<endl; } else if(s<3660)//(s<3721) { m=s/61;//m=s/61; s=s%61; if(m<10&&m>0) cout<<"00:0"<<m; else cout<<"00:"<<m; if(s<10) cout<<":0"<<s<<endl; else cout<<":"<<s<<endl; } else if(s<5000) { h=s/3660;//s/3721; s=s%3660;//s%3721; m=s/61; s=s%61; if(h<10)cout<<"0"<<h; else cout<<h; if(m<10) cout<<":0"<<m; else cout<<":"<<m; if(s<10) cout<<":0"<<s<<endl; else cout<<":"<<s<<endl; } return 0; }</span>
相关文章推荐
- 杭电acm水题,竟然也纠结了半天
- 竟然做了三天水题!!!!作孽啊!!!!!!!
- hdu 2955 水题却wa几次值得反思
- 20160319】的考试【线段树水题却WA的飞起
- hdu 2682 Tree 最小生成树~~~~水题一枚,,用到了筛法求素数,我竟然在格式上面PE了两次!!
- HDU-1093-A+B for Input-Output Practice (V)(水题也WA?)
- ZOJ 1879题解 一道水题没啥好说的,代码贴在这,一开始WA了几次因为题意理解错误,只要报1到n-1每个数都出现一遍就行了
- HDU 1573 X问题 同余方程 竟然wa在条件 答案是正整数上。。无语
- 第四届ZZU校赛第七题 (水题) 该开始题意没看清以为是多组数据呢,多加了换行符,WA了几次,泪奔!
- HDU 4379 水题,大水,但我WA了很多次,做了很久
- hdu1272(并查集水题,然而我状态处于低谷,无限wa呜呜呜)
- HDU2088 水题 竟然忘了初始化 一直wa
- 【lightoj - 1183 - Computing Fast Average(如此水题,竟然也会错?!)】
- hdu 2539 虽然是水题 wa了很多次 说明自己的基本功不扎实 需要打好基础先 少年
- hdu 4891---水题 但是WA了很多次
- HDU 1017A Mathematical Curiosity 水题 WA了6次
- Hduoj2072 【水题】【字符串处理】
- 哈尔滨理工大学软件学院ACM程序设计全国邀请赛(水题5道)
- 【全球同步闰秒调整 6月30日最后一…
- Codeforces 742B Arpa’s obvious problem and Mehrdad’s terrible solution(map水题)