結果
問題 | No.499 7進数変換 |
ユーザー |
![]() |
提出日時 | 2017-04-07 22:34:02 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 237 bytes |
コンパイル時間 | 102 ms |
コンパイル使用メモリ | 21,888 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-16 01:03:36 |
合計ジャッジ時間 | 927 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:6:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%lld", &in); | ~~~~~^~~~~~~~~~~~~
ソースコード
#include<cstdio>unsigned long long int in, ans = 0, cal, l = 1;int main(){scanf("%lld", &in);do{cal = (in % 7);in /= 7;ans += cal * l;l *= 10;}while(in >= 7);ans += in * l;printf("%lld", ans);}