結果
問題 |
No.9002 FizzBuzz(テスト用)
|
ユーザー |
|
提出日時 | 2019-10-13 16:27:55 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 594 bytes |
コンパイル時間 | 14,184 ms |
コンパイル使用メモリ | 379,980 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-15 23:57:04 |
合計ジャッジ時間 | 13,299 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 |
ソースコード
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 { println!("{}", match (x % 5, x % 3) { (0, 0) => "FizzBuzz".to_string(), (_, 0) => "Fizz".to_string(), (0, _) => "Buzz".to_string(), (_, _) => x.to_string(), } ); } }