結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー かわなかかわなか
提出日時 2016-01-05 20:04:12
言語 Rust
(1.77.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 362 bytes
コンパイル時間 4,738 ms
コンパイル使用メモリ 164,684 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 15:21:18
合計ジャッジ時間 1,699 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: use of deprecated method `core::str::<impl str>::trim_right`: superseded by `trim_end`
 --> Main.rs:6:29
  |
6 |     let t = i32::from_str(r.trim_right()).unwrap();
  |                             ^^^^^^^^^^
  |
  = note: `#[warn(deprecated)]` on by default
help: replace the use of the deprecated method
  |
6 |     let t = i32::from_str(r.trim_end()).unwrap();
  |                             ~~~~~~~~

warning: 1 warning emitted

ソースコード

diff #

use std::io::stdin;
use std::str::FromStr;
fn main(){
    let mut r = String::new(); 
    stdin().read_line(&mut r).unwrap();
    let t = i32::from_str(r.trim_right()).unwrap();
    for x in 1..t+1 {
        println!("{}",(if x%3==0&&x%5==0{"FizzBuzz".to_string()}else if x%3==0{"Fizz".to_string()}else if x%5==0{"Buzz".to_string()}else{x.to_string()}));
    }
}
0