結果

問題 No.542 1円玉と5円玉
ユーザー tera_3939tera_3939
提出日時 2017-07-14 23:30:22
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 524 bytes
コンパイル時間 1,195 ms
コンパイル使用メモリ 156,648 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 20:32:51
合計ジャッジ時間 1,745 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,248 KB
testcase_02 WA -
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 1 ms
5,376 KB
testcase_12 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unnecessary parentheses around `if` condition
  --> main.rs:18:15
   |
18 |             if(i + j != 0) {println!("{}", j + i * 5);}
   |               ^          ^
   |
   = note: `#[warn(unused_parens)]` on by default
help: remove these parentheses
   |
18 -             if(i + j != 0) {println!("{}", j + i * 5);}
18 +             if i + j != 0 {println!("{}", j + i * 5);}
   |

warning: 1 warning emitted

ソースコード

diff #

use std::io;

fn get_line() -> String {
    let mut input = String::new();
    io::stdin().read_line(&mut input).unwrap();
    input
}

fn main() {
    let input = get_line();
    let hoge: Vec<usize> = input.trim()
                             .split(" ")
                             .map(|x| x.parse::<usize>().unwrap())
                             .collect();
    let (a, b) = (hoge[0], hoge[1]);
    for i in 0..b+1 {
        for j in 0..a+1 {
            if(i + j != 0) {println!("{}", j + i * 5);}
        }
    }
}
0