結果

問題 No.207 世界のなんとか
ユーザー metasequometasequo
提出日時 2015-06-07 17:24:35
言語 C90
(gcc 11.4.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 291 bytes
コンパイル時間 251 ms
コンパイル使用メモリ 22,784 KB
最終ジャッジ日時 2024-04-17 16:15:32
合計ジャッジ時間 585 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.c: In function ‘main’:
main.c:14:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   14 |         scanf("%d %d", &a, &b);
      |         ^~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/ccgaJZXX.o: in function `three':
main.c:(.text+0x10): undefined reference to `log10'
/usr/bin/ld: main.c:(.text+0x29): undefined reference to `pow'
collect2: error: ld returned 1 exit status

ソースコード

diff #

#include <stdio.h>
#include <math.h>
int three(int n){
	int a = pow(10, (int)log10(n)), m=n;
	while(a!=0){
		if(m/a == 3)	return 1;
		m %= a;
		a /= 10;
	}
	return 0;
}
int main(){
	int a, b, i;
	scanf("%d %d", &a, &b);
	for(i=a; i<=b; i++){
		if(i%3==0 || three(i))	printf("%d\n", i);;
	}
}
0