的银行卡怎么激活激活使用容易吗

题目描述:我们知道人民币有1、2、5、10、20、50、100这几种面值。现在给你n(1≤n≤250)元,让你计算换成用上面这些面额表示且总数不超过100张,共有几种。比如4元,能用4张1元、2张1元和1张2元、2张2元,三种表示方法。输入:输入有多组,每组一行,为一个整合n。输入以0结束。输出:输出该面额有几种表示方法。样例输入:140样例输出:13代码如下:public class zhaoLingQian
static int money[]={1,2,5,10,20,50,100};
public static void main(String[] args)
Scanner sc=new Scanner(System.in);
while (sc.hasNext())
int input=sc.nextInt();
if (input==0)
int count=money.
int index=0;
for (int i = count-1; i &=0; i--)
if (input&=money[i])
System.out.println(ChangeMoney(input,index));
sc.close();
public static int ChangeMoney(int n,int index)
if (n==1||n==0||index==0)
if (n&0||index&0)
return ChangeMoney(n-money[index],index)+ChangeMoney(n,index-1);
}版权声明:本文为博主原创文章,未经博主允许不得转载。
以上就介绍了2015华为机试——找零钱,包括了方面的内容,希望对Java教程有兴趣的朋友有所帮助。
本文网址链接:/article/detail_149221.html
上一篇: 下一篇:&&&&应用:452 当日:0 新闻:1970 当日:0
&&&&&&&&苹果版请使用苹果Safari浏览器访问本站下载,或扫描右侧二维码
91赚零钱 应用介绍
安装送1元,新人任务送1元,10元提现
91赚零钱 应用截图
600 ? this.width=600 : this.width" border="0" alt="91赚零钱" style="margin-bottom:10">
600 ? this.width=600 : this.width" border="0" alt="91赚零钱" style="margin-bottom:10">
600 ? this.width=600 : this.width" border="0" alt="91赚零钱" style="margin-bottom:10">
600 ? this.width=600 : this.width" border="0" alt="91赚零钱" style="margin-bottom:10">

我要回帖

更多关于 新的银行卡怎么激活 的文章

 

随机推荐