解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class Main9 { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int count=0; int []salary=new int[n]; int []money={100,50,10,5,2,1}; for (int i = 0; i < salary.length; i++) { salary[i]=sc.nextInt(); for (int j = 0; j < money.length; j++) { while (salary[i]>=money[j]) { salary[i]-=money[j]; count++; } } } System.out.println(count); } }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题6.5 (C++代码)浏览:458 |
1011题解浏览:766 |
printf基础练习2 (C语言代码)浏览:508 |
C语言程序设计教程(第三版)课后习题10.2 (C语言代码)浏览:690 |
程序员的表白 (C语言代码)浏览:598 |
理财计划 (C语言代码)浏览:468 |
C语言程序设计教程(第三版)课后习题5.8 (C语言代码)浏览:677 |
生日日数 (C语言代码)浏览:1502 |
C语言程序设计教程(第三版)课后习题11.1 (C语言代码)浏览:478 |
C二级辅导-计负均正 (C语言代码)浏览:643 |