結果
問題 |
No.721 Die tertia (ディエ・テルツィア)
|
ユーザー |
|
提出日時 | 2018-11-28 00:49:21 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 912 bytes |
コンパイル時間 | 847 ms |
コンパイル使用メモリ | 84,244 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-24 21:48:07 |
合計ジャッジ時間 | 1,586 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 WA * 1 |
ソースコード
#define _USE_MATH_DEFINES #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<string> #include<iostream> #include<iostream> #include<cctype> #include<cstdio> #include<vector> #include<stack> #include<queue> #include <algorithm> #include<math.h> #include<set> #include<map> #include <sstream> #include<iomanip> #include <ctype.h> using namespace std; //#include<bits/stdc++.h> int main() { string p; cin >> p; int y = 0, m = 0, d = 0; for (int i = 0; i < 4; i++) {y *= 10; y += (p[i] - '0') ; } m += (p[5] - '0') * 10 + p[6] - '0'; d += (p[8] - '0') * 10 + p[9] - '0'; int x[15] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 }; if (y % 4 == 0 && y % 100==0&&y%400==0)x[2] = 29; d += 2; if (d > x[m]) { d -= x[m]; m++; if (m > 12) { y++; m = 1; } } cout << y << "/" ; if (m < 10)cout << "0"; cout << m << "/"; if (d < 10)cout << "0"; cout<< d << endl; return 0; }