满意答案
alexjia301
2015.01.15
采纳率:42% 等级:6
已帮助:257人
123456789101112131415161718192021222324252627/** * 2015年1月15日下午11:36:48 测试通过,望采纳 * @author season * */public class ChangeMoney { /** * getMethodTotal TODO 获取换取的多少种方法 * @param yourMoney 想要换的钱 * @return int 返回方法总数 */ public static int getMethodTotal(int yourMoney){ int method = 0; for(int one =1; one<=98; one++) for(int two =1; two<=49; two++) for(int five =1; five <=19; five++) if(one+two+five==100) method++; return method; } public static void main(String[] args){ System.out.println("\nThe total is: "+getMethodTotal(1)); } }
00分享举报