結果

問題 No.311 z in FizzBuzzString
ユーザー yamayam64510577yamayam64510577
提出日時 2015-12-08 18:32:31
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 1,500 ms
コード長 142 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 20,804 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-25 02:37:37
合計ジャッジ時間 701 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,348 KB
testcase_01 AC 0 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 0 ms
4,348 KB
testcase_05 AC 0 ms
4,348 KB
testcase_06 AC 0 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 0 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function ‘main’:
main.c:4:19: warning: format ‘%lld’ expects argument of type ‘long long int *’, but argument 2 has type ‘long int *’ [-Wformat=]
    4 |         scanf("%lld",&n);
      |                ~~~^  ~~
      |                   |  |
      |                   |  long int *
      |                   long long int *
      |                %ld
main.c:8:20: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 2 has type ‘long int’ [-Wformat=]
    8 |         printf("%lld\n",ans);
      |                 ~~~^    ~~~
      |                    |    |
      |                    |    long int
      |                    long long int
      |                 %ld
main.c:4:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    4 |         scanf("%lld",&n);
      |         ^~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
main(){
	long int n, x3, x5, ans;
	scanf("%lld",&n);
	x3=n/3;
	x5=n/5;
	ans=2*x3+2*x5;
	printf("%lld\n",ans);
	return 0;
}

0