結果

問題 No.499 7進数変換
ユーザー Kura
提出日時 2019-08-01 10:08:17
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 249 bytes
コンパイル時間 1,619 ms
コンパイル使用メモリ 158,240 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-05 07:25:20
合計ジャッジ時間 2,181 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;cin>>n;
  if(n==0){cout<<0<<endl;return 0;}
  bool a=0;
  int m=pow(7,10);
  while(m!=0){
    if(n/m!=0){cout<<n/m;a=1;}
    else if(a)cout<<0;
    n=n%m;
    m/=7;
  }
  cout<<endl;
}
0