結果
| 問題 |
No.9001 標準入出力の練習問題(テスト用)
|
| ユーザー |
かわなか
|
| 提出日時 | 2016-01-05 19:50:40 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 448 bytes |
| コンパイル時間 | 12,851 ms |
| コンパイル使用メモリ | 378,700 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-19 11:29:06 |
| 合計ジャッジ時間 | 12,674 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 2 |
コンパイルメッセージ
warning: use of deprecated method `core::str::<impl str>::trim_right`: superseded by `trim_end` --> src/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` --> src/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(); | ~~~~~~~~
ソースコード
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);
}
かわなか