結果

問題 No.311 z in FizzBuzzString
コンテスト
ユーザー rf141
提出日時 2015-12-04 23:57:38
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
TLE  
実行時間 -
コード長 251 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 178 ms
コンパイル使用メモリ 29,764 KB
最終ジャッジ日時 2026-02-23 19:57:04
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7 TLE * 1 -- * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%ld",&n);
      |         ^~~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include<stdio.h>

int main(){
	long n,i;
	int fi = 4; int th = 2;
	int res = 0;
	scanf("%ld",&n);
	for(i = 1; i <= n; i++){
		if(i%15 == 0){
			res+=fi;
			continue;
		}else if(i%5 == 0 || i%3 == 0){
			res+=th;
		}
	}
	printf("%d",res);
	return 0;
}
0