結果

問題 No.395 永遠の17歳
ユーザー @abcde
提出日時 2019-02-19 23:50:42
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 399 bytes
コンパイル時間 1,401 ms
コンパイル使用メモリ 159,736 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-13 05:27:04
合計ジャッジ時間 2,092 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    
    // 1. 入力情報取得.
    int A;
    cin >> A;
    
    // 2. 17歳と表記できる最小の正整数は?
    string ans = "-1";
    for(int i = 1; i < 101; i++){
        if(i + 7 == A){
            ans = to_string(i);
            break;
        }
    }
    
    // 3. 出力.
    cout << ans << endl;
    return 0;
    
}
0