結果
| 問題 |
No.9002 FizzBuzz(テスト用)
|
| ユーザー |
🇳🇱🦭🇯🇵
|
| 提出日時 | 2024-09-04 08:51:59 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 616 bytes |
| コンパイル時間 | 29,226 ms |
| コンパイル使用メモリ | 402,468 KB |
| 実行使用メモリ | 6,816 KB |
| 最終ジャッジ日時 | 2024-09-04 08:52:29 |
| 合計ジャッジ時間 | 13,618 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
ソースコード
use std::io;
use std::io::prelude::*;
fn fizzbuzz(n: usize) -> String {
match (n % 3, n % 5) {
(0, 0) => "FizzBuzz".to_string(),
(0, _) => "Fizz".to_string(),
(_, 0) => "Buzz".to_string(),
_ => n.to_string(),
}
}
fn main() {
let stdin = io::read_to_string(io::stdin()).unwrap();
let mut stdin = stdin.split_whitespace();
let stdout = io::stdout();
let mut stdout = io::BufWriter::new(stdout.lock());
let n: usize = stdin.next().unwrap().parse::<usize>().unwrap();
for i in 1..=n {
writeln!(stdout, "{}", fizzbuzz(i)).unwrap_or(());
}
}
🇳🇱🦭🇯🇵