結果

問題 No.593 4進FizzBuzz
ユーザー slim
提出日時 2018-01-27 15:38:33
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 453 bytes
コンパイル時間 1,567 ms
コンパイル使用メモリ 29,440 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-29 06:47:21
合計ジャッジ時間 3,730 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20 WA * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'main':
main.c:8:3: warning: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    8 |   gets(n);
      |   ^~~~
      |   fgets
/usr/bin/ld: /tmp/cc9ZaMqw.o: in function `main':
main.c:(.text.startup+0x11): 警告: the `gets' function is dangerous and should not be used.

ソースコード

diff #

#include <stdio.h>
#include <string.h>

int main()
{
  char n[2000001];
  int n10,temp,i,len,four;
  gets(n);
  len = strlen(n)-1;
  n10 = 0;
  four = 1;
  while(len >= 0){
    temp = n[len] - '0';
    n10 += temp * four;
    four *= 4;
    len--;
  }
  if(n10 % 15 == 0){
    printf("FizzBuzz");
  }else if(n10 % 3 == 0){
    printf("Fizz");
  }else if(n10 % 5 == 0){
    printf("Buzz");
  }else{
    printf("%s",n);
  }
  printf("\n");
  return(0);
}
0