結果

問題 No.207 世界のなんとか
ユーザー nekoziroo
提出日時 2018-05-28 15:40:06
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 814 bytes
コンパイル時間 12,975 ms
コンパイル使用メモリ 392,420 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-30 07:46:37
合計ジャッジ時間 13,403 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::stdin;

fn get_line() -> String {
    let mut line = String::new();
    stdin().read_line(&mut line).ok();
    line
}

fn main() {
    let line = get_line();
    let line: Vec<&str> = line.trim().split_whitespace().collect();
    let line: Vec<i32> = line.iter().map(|x| x.parse().unwrap()).collect();

    let a = line[0];
    let b = line[1];

    let mut results: Vec<i32> = Vec::new();

    for i in a..b + 1 {
        if i % 3 == 0 {
            results.push(i);
        } else {
            let str = i.to_string();
            let str = str.as_str();
            for j in str.chars() {
                if j == '3' {
                    results.push(i);
                    break;
                }
            }
        }
    }

    for i in results.iter() {
        println!("{}", i);
    }
}
0