結果

問題 No.9010 うるう年判定
ユーザー tomu28
提出日時 2019-01-26 13:36:36
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 277 bytes
コンパイル時間 477 ms
コンパイル使用メモリ 57,384 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-16 04:55:45
合計ジャッジ時間 1,193 ms
ジャッジサーバーID
(参考情報)
judge6 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 4
other WA * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:18:13: warning: multi-character character constant [-Wmultichar]
   18 |         A = 'Yes';
      |             ^~~~~
main.cpp:19:14: warning: multi-character character constant [-Wmultichar]
   19 |     else A = 'No';
      |              ^~~~
main.cpp: In function ‘int main()’:
main.cpp:18:13: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘5858675’ to ‘'s'’ [-Woverflow]
   18 |         A = 'Yes';
      |             ^~~~~
main.cpp:19:14: warning: overflow in conversion from ‘int’ to ‘char’ changes value from ‘20079’ to ‘'o'’ [-Woverflow]
   19 |     else A = 'No';
      |              ^~~~

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int N;
    string A;
    cin >> N;

    N = N % 4; 
    if (N == 0)
        A = 'Yes';
    else A = 'No';

    cout << A << "\n";
}
0