結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー mtwtkmanmtwtkman
提出日時 2019-10-13 16:18:29
言語 Rust
(1.77.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 567 bytes
コンパイル時間 18,759 ms
コンパイル使用メモリ 378,804 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-09 11:15:28
合計ジャッジ時間 19,589 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,248 KB
testcase_02 AC 1 ms
5,248 KB
testcase_03 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::{self, Read};

fn read_stdin<'a>() -> Vec<String> {
    let mut buffer = String::new();
    io::stdin().read_to_string(&mut buffer).ok();
    buffer.trim().split('\n').map(|s| s.to_string()).collect()
}

fn main() {
    let i = read_stdin().first().unwrap().parse::<i32>().unwrap();
    for x in 1..i + 1 {
        if x % 15 == 0 {
            println!("FizzBuzz");
        } else if x % 5 == 0 {
            println!("Buzz");
        } else if x % 3 == 0 {
            println!("Fizz");
        } else {
            println!("{}", x);
        }
    }
}
0