Task: | Backpacking |
Sender: | odanobunaga8199 |
Submission time: | 2024-09-02 17:09:33 +0300 |
Language: | Rust |
Status: | READY |
Result: | RUNTIME ERROR |
test | verdict | time | |
---|---|---|---|
#1 | RUNTIME ERROR | 0.00 s | details |
#2 | RUNTIME ERROR | 0.00 s | details |
#3 | RUNTIME ERROR | 0.00 s | details |
#4 | RUNTIME ERROR | 0.00 s | details |
Compiler report
warning: unused `Result` that must be used --> input/code.rs:5:5 | 5 | io::stdin().read_line(&mut input1); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this `Result` may be an `Err` variant, which should be handled = note: `#[warn(unused_must_use)]` on by default help: use `let _ = ...` to ignore the resulting value | 5 | let _ = io::stdin().read_line(&mut input1); | +++++++ warning: unused `Result` that must be used --> input/code.rs:8:5 | 8 | io::stdin().read_line(&mut input2); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this `Result` may be an `Err` variant, which should be handled help: use `let _ = ...` to ignore the resulting value | 8 | let _ = io::stdin().read_line(&mut input2); | +++++++ warning: 2 warnings emitted
Code
use std::io; fn main() { let mut input1 = String::new(); io::stdin().read_line(&mut input1); let num1: i32 = input1.trim().parse().unwrap(); let mut input2 = String::new(); io::stdin().read_line(&mut input2); let num2: i32 = input2.trim().parse().unwrap(); println!("{}", num1 + num2); }
Test details
Test 1
Verdict: RUNTIME ERROR
input |
---|
3 5 |
correct output |
---|
8 |
user output |
---|
(empty) |
Error:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { ki...
Test 2
Verdict: RUNTIME ERROR
input |
---|
571335 750047 |
correct output |
---|
1321382 |
user output |
---|
(empty) |
Error:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { ki...
Test 3
Verdict: RUNTIME ERROR
input |
---|
744471 719178 |
correct output |
---|
1463649 |
user output |
---|
(empty) |
Error:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { ki...
Test 4
Verdict: RUNTIME ERROR
input |
---|
308833 436123 |
correct output |
---|
744956 |
user output |
---|
(empty) |
Error:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseIntError { ki...