結果
問題 |
No.499 7進数変換
|
ユーザー |
![]() |
提出日時 | 2025-03-06 16:20:03 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 264 bytes |
コンパイル時間 | 475 ms |
コンパイル使用メモリ | 27,008 KB |
実行使用メモリ | 18,624 KB |
最終ジャッジ日時 | 2025-03-06 16:20:08 |
合計ジャッジ時間 | 5,014 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | TLE * 1 -- * 30 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:5:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | scanf("%d",&num); | ~~~~~^~~~~~~~~~~ main.cpp:17:23: warning: ‘ans’ may be used uninitialized [-Wmaybe-uninitialized] 17 | printf("%d",p[i]); | ~~~~~~^~~~~~~~~~~ main.cpp:7:13: note: ‘ans’ declared here 7 | int ans[20]; | ^~~
ソースコード
#include <stdio.h> int main(){ int num = 0; scanf("%d",&num); int ans[20]; int *p = ans; int element = 0; while(num < 7){ p[element] = num % 7; num /= 7; element++; } for(int i = element;i >= 0;i--){ printf("%d",p[i]); } printf("%d",num); }