3445 - 钱币兑换1

【问题描述】

把一张一元钞票换成1分、2分和5分的硬币,每种至少1枚,问有几种换法?

【输出格式】

一行,表示有多少种

题目输入

题目输出

输入/输出样例

题目输入


                

题目输出


                

C++解答

#include<bits/stdc++.h>
using namespace std;
int s;
int main()
{
	for(int i=1;i<=10;i++)
	{
		for(int j=1;j<=5;j++)
		{
			for(int k=1;k<=2;k++)
			{
				if(i+j+k==10)
					s++;
			}
		}
	}
	cout<<s;
	return 0;
}
时间限制 1 秒
内存限制 128 MB
讨论 统计
上一题 下一题