結果

問題 No.207 世界のなんとか
ユーザー AIZAWA Masahiro
提出日時 2017-04-23 21:21:34
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 338 bytes
コンパイル時間 849 ms
コンパイル使用メモリ 56,084 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-22 10:09:07
合計ジャッジ時間 1,507 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

bool is_contains_three(int i) {
  return std::to_string(i).find("3") != std::string::npos;
}

int main() {
  int n, m;
  std::cin >> n >> m;
  for (int i = n; i <= m; i++) {
    if (i % 3 == 0) {
      std::cout << i << std::endl;
    } else if (is_contains_three(i)) {
      std::cout << i << std::endl;
    }
  }
}
0