文章

37

粉丝

67

获赞

3

访问

9.5k

头像
Aconly时间戳 题解:
P1545 杭州电子科技大学机试题
发布于2024年3月10日 13:50
阅读数 163

#include<iostream>
#include<algorithm>
#include<string>
using namespace std;

int main()
{
    int cnt;
    int nums[13] = { 0,30,28,31,30,31,30,31,31,30,31,30,31 };
    if (2009 % 4 == 0 && 2009 % 100 != 0 || 2009 % 400 == 0) {
        nums[2] = 29;
    }
    while (cin >> cnt) {
        int n, month = 1, day = 1, hour = 0, minute = 0, second = 0;
        //多少天
        day = cnt / (24 * 60 * 60);
        //开始定日期
        if (day != 0) {
            if (day < nums[1]) {//因为从1开始算的天数
                day++;
            }
            else {
                for (int k = 1; k < 13; k++) {
  ...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发