結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー Eclair1015
提出日時 2018-09-27 22:27:12
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 830 bytes
コンパイル時間 712 ms
コンパイル使用メモリ 75,220 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-12 04:36:55
合計ジャッジ時間 1,320 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

//inlclude前用define 
#define _USE_MATH_DEFINES

//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<cstdio>
#include<type_traits>
#include<numeric>
#include<limits>
#include<iomanip>
using namespace std;
//typedef
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;

//grobal変数


int main() {
	int y, m, d;
	char d1, d2;
	cin >> y >> d1 >> m >> d2 >> d;
	VI day = { 31,28,31,30,31,30,31,31,30,31,30,31};

	d += 2;

	if (y % 4 == 0 && y%100!=0) {
		day[1] = 29;
	}else if (y % 400 == 0) {
		day[1] = 29;
	}

	if (day[m - 1] < d) {
		d -= day[m - 1];
		m++;
	}

	if (m > 12) {
		y++;
		m -= 12;
	}
	cout << y << d2;
	cout << setfill('0') << right << setw(2) << m << d1;
	cout << setfill('0') << right << setw(2) << d;
	cout << "\n";
	return 0;
}
0