結果

問題 No.499 7進数変換
ユーザー kikage
提出日時 2020-04-03 01:53:10
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 248 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 23,168 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 16:45:14
合計ジャッジ時間 1,100 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:4:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    4 |     scanf("%d",&N);
      |     ~~~~~^~~~~~~~~

ソースコード

diff #

#include <cstdio>
int main(){
    int N,A[18]={0},p=0;
    scanf("%d",&N);
    if(N>0){
        while(N>0){
            A[p++]=N%7;N/=7;
        }
        while(p>0)printf("%d",A[--p]);
        printf("\n");
    }else printf("0\n");
    return 0;
}
0