結果

問題 No.32 貯金箱の憂鬱
ユーザー hitoyozakehitoyozake
提出日時 2018-05-03 22:00:17
言語 Rust
(1.77.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 480 bytes
コンパイル時間 628 ms
コンパイル使用メモリ 139,648 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-30 13:09:59
合計ジャッジ時間 1,270 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused variable: `x`
 --> Main.rs:7:9
  |
7 |     let x = std::io::stdin().read_line(& mut buf).ok();
  |         ^ help: if this is intentional, prefix it with an underscore: `_x`
  |
  = note: `#[warn(unused_variables)]` on by default

warning: variable does not need to be mutable
  --> Main.rs:15:9
   |
15 |     let mut l = read_line().trim().parse::<i32>().unwrap();
   |         ----^
   |         |
   |         help: remove this `mut`
   |
   = note: `#[warn(unused_mut)]` on by default

warning: variable does not need to be mutable
  --> Main.rs:16:9
   |
16 |     let mut m = read_line().trim().parse::<i32>().unwrap();
   |         ----^
   |         |
   |         help: remove this `mut`

warning: variable does not need to be mutable
  --> Main.rs:17:9
   |
17 |     let mut n = read_line().trim().parse::<i32>().unwrap();
   |         ----^
   |         |
   |         help: remove this `mut`

warning: 4 warnings emitted

ソースコード

diff #



fn read_line()->String{
    let mut buf = String::new();

    let x = std::io::stdin().read_line(& mut buf).ok();

    buf
}



fn main() {
    let mut l = read_line().trim().parse::<i32>().unwrap();
    let mut m = read_line().trim().parse::<i32>().unwrap();
    let mut n = read_line().trim().parse::<i32>().unwrap();

    let x = l*100 + m*25 + n;

    let result = (x % 1000) / 100 + ((x % 1000) % 100) / 25 + (((x%1000)%100)%25); 
    

    println!("{}", result);
    
}
0