結果

問題 No.311 z in FizzBuzzString
ユーザー HaijinnHaijinn
提出日時 2016-10-27 22:51:32
言語 C90
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 468 bytes
コンパイル時間 119 ms
コンパイル使用メモリ 21,536 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-25 02:47:38
合計ジャッジ時間 4,293 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 | scanf("%ld",&i);
      | ^~~~~~~~~~~~~~~

ソースコード

diff #

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

int main(void)
{
unsigned long i;
scanf("%ld",&i);
int t=1;
char s[100000];
char r[100000];
int y;
int w;
int g=0;
for(t;t<=i;t++){
	
	if(t%15==0){
		
	strcat(s,"FizzBuzz");
		
		
		
	}else if(t%3==0){
		
		
		
		strcat(s,"Fizz");
		
		
	}else if(t%5==0){
		
		
		strcat(s,"Buzz\n");
		
	}else{
		sprintf(r,"%d",t);
		strcat(s,r);
		
	}

}

w=strlen(s);
for(y=0;y<=w;y++){
	if(s[y]=='z'){
		g++;
	}
}
printf("%d",g);
return 0;
}
0