結果
| 問題 |
No.9002 FizzBuzz(テスト用)
|
| ユーザー |
|
| 提出日時 | 2020-07-28 23:55:21 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 636 bytes |
| コンパイル時間 | 11,061 ms |
| コンパイル使用メモリ | 404,120 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-28 21:07:14 |
| 合計ジャッジ時間 | 11,925 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
ソースコード
use std::fmt::Debug;
use std::io::stdin;
use std::str::FromStr;
fn read_line<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err: Debug {
let mut s = String::new();
stdin().read_line(&mut s).unwrap();
s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()
}
fn main() {
let line1: Vec<usize> = read_line();
let n: usize = line1[0];
(1..n + 1).for_each(|x| {
match x {
it if it % 15 == 0 => println!("FizzBuzz"),
it if it % 5 == 0 => println!("Buzz"),
it if it % 3 == 0 => println!("Fizz"),
_ => println!("{}", x)
}
});
}