分钱:
五块钱,换成一块、五毛、一毛,有几种换法?
流程图:
伪代码:
源代码:
#include<iostream>
using namespace std;
int main (){
int yuan[6]={0,10,20,30,40,50};
int jiao[11]={0,5,10,15,20,25,30,35,40,45,50};
int i,j,k,m=1;
for(i=0;i<=50;i++){
for(j=0;j<11;j++){
for(k=0;k<6;k++){
if(yuan[k]+jiao[j]+i==50){
cout<<m<<":"<<k<<","<<j<<","<<i<<"\n"<<endl;
m++;
}
}
}
}
return 0;
}
标签:21,jiao,int,30,50,c++,打卡 From: https://www.cnblogs.com/HD-Kudu-2219/p/17375275.html