結果

問題 No.499 7進数変換
ユーザー Shawn stayC
提出日時 2020-07-06 00:19:22
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 282 bytes
コンパイル時間 1,498 ms
コンパイル使用メモリ 168,404 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-23 06:16:56
合計ジャッジ時間 2,476 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
typedef long long ll;

int main(){
	int n; cin>>n;
	string ans;
	while(n>6){
		int r=n%7;
		ans+=to_string(r);
		n/=7;
	}
	ans+=to_string(n);
	reverse(ans.begin(),ans.end());
	cout<<ans<<endl;
}
0