题解|1、2、5分凑一元
#include <bits/stdc++.h>
using namespace std;
int main() {
//i,j,k represent 1 cent, 2 cents and 5 cents respectively
int res = 0;
for(int i=0;i<=100;i++)
for(int j =0;j<=50;j++)
for(int k =0;k<=20;k++)
if(i+2*j+5*k == 100)res++;
cout<<res<<endl;
}
三重循环硬做的...递归了半天没做明白