結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー tmtm
提出日時 2022-11-15 22:03:35
言語 Rust
(1.77.0)
結果
RE  
実行時間 -
コード長 356 bytes
コンパイル時間 1,573 ms
コンパイル使用メモリ 136,544 KB
実行使用メモリ 4,480 KB
最終ジャッジ日時 2023-10-15 03:15:16
合計ジャッジ時間 1,692 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused variable: `i`
  --> 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

warning: 1 warning emitted

ソースコード

diff #

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);
}
0