結果
問題 |
No.207 世界のなんとか
|
ユーザー |
![]() |
提出日時 | 2018-05-26 00:26:05 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 439 bytes |
コンパイル時間 | 92 ms |
コンパイル使用メモリ | 23,296 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-28 18:07:12 |
合計ジャッジ時間 | 736 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 WA * 10 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:18:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 18 | scanf("%d %d", &A, &B); | ~~~~~^~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <string.h> int exit_3(int a){ char str[256]; int i, len, flag = 0; sprintf(str, "%d", a); len = strlen(str); for(i = 0; i < len; i++){ if(str[i] == '3') flag = 1; } return flag; } int main(){ int A, B, i; scanf("%d %d", &A, &B); for(i = A; i < B; i++){ if(i%3 == 0 || exit_3(i) == 1){ printf("%d\n", i); } } return 0; }