結果
問題 | No.207 世界のなんとか |
ユーザー |
|
提出日時 | 2015-06-07 17:22:52 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 301 bytes |
コンパイル時間 | 357 ms |
コンパイル使用メモリ | 30,720 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-09 10:22:48 |
合計ジャッジ時間 | 3,036 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 19 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:14:18: warning: format ‘%ld’ expects argument of type ‘long int*’, but argument 2 has type ‘int*’ [-Wformat=] 14 | scanf("%ld %ld", &a, &b); | ~~^ ~~ | | | | | int* | long int* | %d main.cpp:14:22: warning: format ‘%ld’ expects argument of type ‘long int*’, but argument 3 has type ‘int*’ [-Wformat=] 14 | scanf("%ld %ld", &a, &b); | ~~^ ~~ | | | | | int* | long int* | %d main.cpp:14:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 14 | scanf("%ld %ld", &a, &b); | ~~~~~^~~~~~~~~~~~~~~~~~~
ソースコード
#include <cstdio>#include <math.h>bool three(int n){int a = pow(10, (int)log10(n)), m=n;while(a!=0){if(m/a == 3) return true;m %= a;a /= 10;}return false;}int main(){int a, b;scanf("%ld %ld", &a, &b);for(int i=a; i<=b; i++){if(i%3==0 || three(i)) printf("%d\n", i);;}}