結果
問題 |
No.721 Die tertia (ディエ・テルツィア)
|
ユーザー |
![]() |
提出日時 | 2025-03-26 10:55:36 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 501 bytes |
コンパイル時間 | 1,298 ms |
コンパイル使用メモリ | 24,064 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-26 10:55:38 |
合計ジャッジ時間 | 1,410 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:6:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d/%d/%d", &year , &month , &day ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> void main(void){ int dayList[12] = {31,28,31,30,31,30,31,31,30,31,30,31}; int year = 0 , month = 0,day = 0; scanf("%d/%d/%d", &year , &month , &day ); if((year % 4 == 0) ^ (year % 100 == 0) ^ (year % 400 == 0)){ dayList[1] += 1; } day += 2; if(dayList[month-1] < day){ day = day - dayList[month-1]; month++; } if(month > 12){ month = 1; year++; } printf("%d/%02d/%02d",year,month,day); }