結果
| 問題 | No.9002 FizzBuzz(テスト用) |
| ユーザー |
|
| 提出日時 | 2017-02-27 11:43:01 |
| 言語 | C90 (gcc 12.4.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 319 bytes |
| 記録 | |
| コンパイル時間 | 533 ms |
| コンパイル使用メモリ | 20,096 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-11 19:19:14 |
| 合計ジャッジ時間 | 966 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d",&i);
| ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(int argc, char *argv[]){
int s,i;
scanf("%d",&i);
for( s=1; s <= i; s++){
if (s%3 == 0 && s%5 == 0) {
printf("FizzBuzz\n");
} else if (s%5 == 0) {
printf("Buzz\n");
} else if (s%3 == 0 ) {
printf("Fizz\n");
} else {
printf("%d\n",s);
}
}
return 0;
}