結果

問題 No.499 7進数変換
ユーザー Konton7
提出日時 2020-01-14 14:56:17
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 360 bytes
コンパイル時間 1,793 ms
コンパイル使用メモリ 194,564 KB
最終ジャッジ日時 2025-01-08 17:59:33
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;


int main(){
    int a;
    cin >> a;
    if (a == 0)
        cout << 0 << endl;
    else{
        string ans;
        while (a > 0){
            ans += (a % 7) + '0';
            a /= 7;
        }
        reverse(ans.begin(), ans.end());
        cout << ans << endl;
    }
    return 0;

}
0