結果
| 問題 | No.9001 標準入出力の練習問題(テスト用) |
| ユーザー |
かわなか
|
| 提出日時 | 2016-01-05 19:50:40 |
| 言語 | Rust (1.94.0 + proconio + num + itertools) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 448 bytes |
| 記録 | |
| コンパイル時間 | 1,128 ms |
| コンパイル使用メモリ | 208,920 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-04-07 22:23:27 |
| 合計ジャッジ時間 | 2,002 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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_right()).unwrap() + i32::from_str(v[1].trim_right()).unwrap(); 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_right()).unwrap(); 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);
}
かわなか