結果
| 問題 | No.721 Die tertia (ディエ・テルツィア) |
| コンテスト | |
| ユーザー |
suppy193
|
| 提出日時 | 2023-11-16 20:10:25 |
| 言語 | C90(gcc15) (gcc 15.2.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 740 bytes |
| 記録 | |
| コンパイル時間 | 467 ms |
| コンパイル使用メモリ | 38,092 KB |
| 最終ジャッジ日時 | 2026-02-24 01:17:18 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 18 |
ソースコード
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main(void){
char s[20], s1[20];
int year, mon, day;
int i;
struct tm nntm = { 0, 0, 0, 1, 1, 2000 };
time_t nnt;
scanf("%s", s);
printf("%s\n", s);
s1[0] = s[0];
s1[1] = s[1];
s1[2] = s[2];
s1[3] = s[3];
s1[4] = 0;
year = atoi(s1);
s1[0] = s[5];
s1[1] = s[6];
s1[2] = 0;
mon = atoi(s1);
s1[0] = s[8];
s1[1] = s[9];
s1[2] = 0;
day = atoi(s1);
if((year == 2000 || year == 2400) && mon == 2){
printf("%d/%02d/%02d\n", year, mon, day + 2);
}
else {
nntm.tm_year = year;
nntm.tm_mon = mon - 1;
nntm.tm_mday = day + 2;
nnt = mktime(&nntm);
printf("%d/%02d/%02d\n", nntm.tm_year, nntm.tm_mon + 1, nntm.tm_mday);
}
return 0;
}
suppy193