fn main() { let C: [i32; 6] = [3, 2, 1, 3, 0, 2]; let mut A = 620; let V: [i32; 6] = [1, 5, 10, 50, 100, 500]; let mut ans: i32 = 0; for i in (0..6).rev() { let t = std::cmp::min(A / V[i], C[i]); A -= t * V[i]; ans += t; } println!("{}", ans); }


ソフトウェアエンジニアの技術ブログ:Software engineer tech blog
随机应变 ABCD: Always Be Coding and … : хороший