結果

問題 No.9001 標準入出力の練習問題(テスト用)
ユーザー かわなかかわなか
提出日時 2016-01-05 19:50:40
言語 Rust
(1.77.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 448 bytes
コンパイル時間 1,871 ms
コンパイル使用メモリ 174,556 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 15:21:01
合計ジャッジ時間 1,426 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

warning: use of deprecated method `core::str::<impl str>::trim_right`: superseded by `trim_end`
  --> Main.rs:10:76
   |
10 |         r = i32::from_str(v[0].trim_right()).unwrap() + i32::from_str(v[1].trim_right()).unwrap();
   |                                                                            ^^^^^^^^^^
   |
help: replace the use of the deprecated method
   |
10 |         r = i32::from_str(v[0].trim_right()).unwrap() + i32::from_str(v[1].trim_end()).unwrap();
   |                                                                            ~~~~~~~~

warning: 2 warnings emitted

ソースコード

diff #

use std::io::stdin;
use std::str::FromStr;
fn main(){
    let mut line = String::new();
    let r :i32;
    stdin().read_line(&mut line).unwrap();
    {
        let s = line.clone();
        let v: Vec<&str> = s.split(' ').collect();
        r = i32::from_str(v[0].trim_right()).unwrap() + i32::from_str(v[1].trim_right()).unwrap();
    }
    line = "".to_string();
    stdin().read_line(&mut line).unwrap();    
    println!("{} {}",r,line);    
}
0