結果

問題 No.1129 Rating じゃんけん
ユーザー かりあげクンかりあげクン
提出日時 2020-08-05 10:43:31
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 736 bytes
コンパイル時間 679 ms
コンパイル使用メモリ 141,292 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-14 07:58:20
合計ジャッジ時間 1,617 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 WA -
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 1 ms
4,352 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,352 KB
testcase_06 AC 1 ms
4,352 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,352 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,352 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 1 ms
4,352 KB
testcase_15 WA -
testcase_16 AC 1 ms
4,352 KB
testcase_17 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: value assigned to `ans` is never read
  --> Main.rs:10:13
   |
10 |     let mut ans = "Draw";
   |             ^^^
   |
   = help: maybe it is overwritten before being read?
note: the lint level is defined here
  --> Main.rs:1:8
   |
1  | #[warn(unused_assignments)]
   |        ^^^^^^^^^^^^^^^^^^

warning: 1 warning emitted

ソースコード

diff #

#[warn(unused_assignments)]
fn main() {
    let mut abcd = String::new();
    std::io::stdin().read_line(&mut abcd).ok();
    let abcd: Vec<i32> = abcd.trim().split_whitespace().map(|s| s.parse().unwrap()).collect();
    let a = abcd[0];
    let b = abcd[1];
    let c = abcd[2];
    let d = abcd[3];
    let mut ans = "Draw";
    if a < c {
        ans = "tRue";
        println!("{}", ans);
    } else if a > c {
        ans = "null";
        println!("{}", ans);
    } else {
        if b > d {
            ans = "null";
            println!("{}", ans);
        } else if b < d {
            ans = "tRue";
            println!("{}", ans);
        } else {
            ans = "Draw";
            println!("{}", ans);
        }
    }
}
0