結果

問題 No.1543 [Cherry 2nd Tune A] これがプログラミングなのね
ユーザー seinyan
提出日時 2021-11-02 21:24:59
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 607 bytes
コンパイル時間 12,532 ms
コンパイル使用メモリ 400,288 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-12 03:28:35
合計ジャッジ時間 13,867 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io;
fn main() {
    let v = input_strings();

    let s = v[0].parse::<i32>().unwrap();
    let t = v[1].parse::<i32>().unwrap();
    let result: bool;
    let c: &str = &v[2];
    match c {
        "<" => result = s < t,
        ">" => result = s > t,
        "=" => result = s == t,
        _ => result = false,
    }
    println!("{}", if result { "YES" } else { "NO" });
}
fn input_strings() -> Vec<String> {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    let mut v = Vec::new();
    for n in s.split_whitespace() {
        v.push(String::from(n));
    }
    v
}
0