結果
| 問題 | No.499 7進数変換 |
| コンテスト | |
| ユーザー |
Bantako
|
| 提出日時 | 2017-07-17 22:00:22 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 250 bytes |
| コンパイル時間 | 309 ms |
| コンパイル使用メモリ | 44,924 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-08 07:09:26 |
| 合計ジャッジ時間 | 1,172 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
4 | main(){
| ^~~~
main.cpp: In function ‘int main()’:
main.cpp:6:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d",&N);
| ~~~~~^~~~~~~~~
ソースコード
#include<stdio.h>
#include<string>
using namespace std;
main(){
int N;
scanf("%d",&N);
string str;
while(N!=0){
char c = N%7+'0';
str = c + str;
N /= 7;
}
printf("%s\n",str.empty()?"0":str.c_str());
}
Bantako