結果

問題 No.207 世界のなんとか
ユーザー ゆーたろ
提出日時 2016-11-19 13:09:08
言語 C90
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 224 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 20,608 KB
実行使用メモリ 15,048 KB
最終ジャッジ日時 2024-11-26 21:46:33
合計ジャッジ時間 121,426 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other TLE * 19
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:17: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘long unsigned int *’ [-Wformat=]
    6 |         scanf("%d %d", &a, &b);
      |                ~^      ~~
      |                 |      |
      |                 int *  long unsigned int *
      |                %ld
main.c:6:20: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘long unsigned int *’ [-Wformat=]
    6 |         scanf("%d %d", &a, &b);
      |                   ~^       ~~
      |                    |       |
      |                    int *   long unsigned int *
      |                   %ld
main.c:13:34: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
   13 |                 if(c==1)printf("%d\n", i);
      |                                 ~^     ~
      |                                  |     |
      |                                  int   long unsigned int
      |                                 %ld
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d %d", &a, &b);
      |         ^~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void) {
	unsigned long a, b, c, i, t;
	
	scanf("%d %d", &a, &b);
	
	for(i=a; i<=b; i++){
		if(i%3==0)c=1;
		for(t=i; t; t/10)
			if(t%10==3)
				c=1;
		if(c==1)printf("%d\n", i);
	}
	return 0;
}
0