結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー suppy193suppy193
提出日時 2023-11-16 20:11:41
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 742 bytes
コンパイル時間 107 ms
コンパイル使用メモリ 21,504 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-11-16 20:11:42
合計ジャッジ時間 859 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
6,676 KB
testcase_01 AC 1 ms
6,676 KB
testcase_02 AC 1 ms
6,676 KB
testcase_03 AC 1 ms
6,676 KB
testcase_04 AC 0 ms
6,676 KB
testcase_05 AC 1 ms
6,676 KB
testcase_06 AC 1 ms
6,676 KB
testcase_07 AC 1 ms
6,676 KB
testcase_08 AC 1 ms
6,676 KB
testcase_09 AC 1 ms
6,676 KB
testcase_10 AC 0 ms
6,676 KB
testcase_11 AC 1 ms
6,676 KB
testcase_12 AC 0 ms
6,676 KB
testcase_13 AC 1 ms
6,676 KB
testcase_14 AC 0 ms
6,676 KB
testcase_15 AC 0 ms
6,676 KB
testcase_16 WA -
testcase_17 AC 1 ms
6,676 KB
testcase_18 WA -
testcase_19 AC 0 ms
6,676 KB
testcase_20 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:13:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   13 |         scanf("%s", s);
      |         ^~~~~~~~~~~~~~

ソースコード

diff #

#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;
	
}
0