結果

問題 No.499 7進数変換
ユーザー 西尾
提出日時 2018-03-16 12:14:03
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 287 bytes
コンパイル時間 1,449 ms
コンパイル使用メモリ 166,712 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-21 14:22:37
合計ジャッジ時間 2,499 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

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

char S[ 25 ];

int main()
{
int i;
int iPos;
int a;
int N;
	
	cin >> N;

	iPos = 20;
	a = N % 7;
	S[ iPos ] = '0' + a;
	while( ( N /= 7 ) > 0 )
	{
		iPos--;
		a = N % 7;
		S[ iPos ] = '0' + a;
	}

	cout << S + iPos << endl;

	return 0;
}


0