結果

問題 No.499 7進数変換
ユーザー れいん
提出日時 2024-11-22 10:47:35
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 292 bytes
コンパイル時間 1,874 ms
コンパイル使用メモリ 192,340 KB
最終ジャッジ日時 2025-02-25 05:51:59
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

    cout << ans;
}
0