3445 - 钱币兑换1
【问题描述】
把一张一元钞票换成1分、2分和5分的硬币,每种至少1枚,问有几种换法?
【输出格式】
一行,表示有多少种
Input
Output
Examples
Input
Output
Solution 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; }