結果
問題 |
No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
|
ユーザー |
|
提出日時 | 2022-11-15 22:03:35 |
言語 | Rust (1.83.0 + proconio) |
結果 |
RE
|
実行時間 | - |
コード長 | 356 bytes |
コンパイル時間 | 12,869 ms |
コンパイル使用メモリ | 386,552 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-16 20:47:43 |
合計ジャッジ時間 | 13,980 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 4 |
other | RE * 15 |
コンパイルメッセージ
warning: unused variable: `i` --> src/main.rs:11:9 | 11 | for i in 0..num { | ^ help: if this is intentional, prefix it with an underscore: `_i` | = note: `#[warn(unused_variables)]` on by default
ソースコード
fn getline() -> String { let mut a = String::new(); std::io::stdin().read_line(&mut a).ok(); return a; } fn main() { let b = getline(); let num: i32 = b.trim().parse().unwrap(); let mut res: i32 = 0; for i in 0..num { let c = getline(); res += c.trim().parse::<i32>().unwrap(); } println!("{}", res); }