文件名称:cPPpractice
介绍说明--下载内容均来自于网络,请自行研究使用
第6章(上)编程作业第1题题目:
1、输入一个正整数n,它代表一个人民币钱数(元数)。求取这样一个方案,使用最少张数的人民币纸币,凑成上述的钱数n。
注:共有七种元以上面值的人民币纸币,分别为:100,50,20,10,5,2,1。假设输入数据为196时,
则最少要用6张人民币纸币:196 = 1*100 + 1*50 2*20 + 1*5 + 1*1。当输入数据为908时,
则最少要用12张人民币纸币:908 = 9*100 + 1*5 + 1*2 + 1*1。
可设计一个程序,使执行后的屏幕显示结果具有如下形式:
Input a positive intdger: 196<回车>
196 (yuan) = 1*100 + 1*50 + 2*20 + 1*5 + 1*1 (yuan)
total_sheet = 6
*/-Chapter 6 (I) programming assignment questions Question 1: 1, enter a positive integer n, it represents an RMB amount of money (metadata). To strike such a program, using the least number of sheets of RMB notes, make up the amount of money n. Note: There are seven par value of RMB yuan notes are: 100,50,20,10,5,2,1. Assuming the input data is 196, then at least use the six yuan notes: 196 = 1* 100+ 1* 50 2* 20+ 1* 5+ 1* 1. When the input data for the 908, then at least use the 12 yuan note: 908 = 9* 100+ 1* 2+ 5+ 1* 1* 1. A program can be designed so that the screen displays the results after the execution has the following form: Input a positive intdger: 196 < Enter> 196 (yuan) = 1* 100+ 1* 50+ 2* 20+ 1* 5+ 1* 1 (yuan) total_sheet = 6* /
1、输入一个正整数n,它代表一个人民币钱数(元数)。求取这样一个方案,使用最少张数的人民币纸币,凑成上述的钱数n。
注:共有七种元以上面值的人民币纸币,分别为:100,50,20,10,5,2,1。假设输入数据为196时,
则最少要用6张人民币纸币:196 = 1*100 + 1*50 2*20 + 1*5 + 1*1。当输入数据为908时,
则最少要用12张人民币纸币:908 = 9*100 + 1*5 + 1*2 + 1*1。
可设计一个程序,使执行后的屏幕显示结果具有如下形式:
Input a positive intdger: 196<回车>
196 (yuan) = 1*100 + 1*50 + 2*20 + 1*5 + 1*1 (yuan)
total_sheet = 6
*/-Chapter 6 (I) programming assignment questions Question 1: 1, enter a positive integer n, it represents an RMB amount of money (metadata). To strike such a program, using the least number of sheets of RMB notes, make up the amount of money n. Note: There are seven par value of RMB yuan notes are: 100,50,20,10,5,2,1. Assuming the input data is 196, then at least use the six yuan notes: 196 = 1* 100+ 1* 50 2* 20+ 1* 5+ 1* 1. When the input data for the 908, then at least use the 12 yuan note: 908 = 9* 100+ 1* 2+ 5+ 1* 1* 1. A program can be designed so that the screen displays the results after the execution has the following form: Input a positive intdger: 196 < Enter> 196 (yuan) = 1* 100+ 1* 50+ 2* 20+ 1* 5+ 1* 1 (yuan) total_sheet = 6* /
(系统自动生成,下载前可以参看下载内容)
下载文件列表
c++practice.cpp