結果

問題 No.207 世界のなんとか
ユーザー nyan68682154
提出日時 2019-05-12 20:18:49
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 406 bytes
コンパイル時間 460 ms
コンパイル使用メモリ 58,708 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-05 05:19:50
合計ジャッジ時間 1,004 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<math.h>
using namespace std;

int main() 
{
	int a,b,i,n;
	cin >> a >> b;
	for (i = a; i  < b+1;i++) {
		if (i % 3 == 0) {
			cout << i << "\n";
		}
		else {
			int s = i;
			for (n = 30; n >= 0; n--) {
				int pn = pow(10, n);
				if (s / pn == 3) {
					cout << i<<"\n";
					break;
				}
				else if (s >= pn) {
					s = s - pn*(s/pn);
				}

			}
		}
	}

} 
0