結果

問題 No.499 7進数変換
ユーザー 小指が強い人
提出日時 2017-04-08 21:49:31
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 307 bytes
コンパイル時間 713 ms
コンパイル使用メモリ 69,372 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-17 23:56:48
合計ジャッジ時間 1,692 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdlib>
#include <algorithm>

using namespace std;

int main()
{
    int n;
    cin>>n;
    if(n==0)cout<<n<<endl,exit(0);
    string res;
    while(n>0){
        res+=to_string(n%7);
        n/=7;
    }
    reverse(res.begin(),res.end());
    cout<<res<<endl;
    return 0;
}
0