結果

問題 No.499 7進数変換
ユーザー akakimidori
提出日時 2017-04-19 13:32:18
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 276 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 20,608 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-19 09:25:08
合計ジャッジ時間 1,065 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘run’:
main.c:5:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |   scanf("%lld",&n);
      |   ^~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>

void run(void){
  long long int n;
  scanf("%lld",&n);

  const int p=7;
  long long int t=1;
  while(p*t<=n){
    t*=p;
  }
  while(t>=1){
    printf("%lld",n/t);
    n=n%t;
    t/=p;
  }
  printf("\n");
  return;
}

int main(void){
  run();
  return 0;
}
0