//需求:求出一个偶数纸币需要多少张50元,20元,10元来配合
include <stdio.h>
int main(void){
int n = 0; //存储你输入的数值
int i = 0;// for循环使用
int j = 0;
int k = 0;
int w = 50;定义50元的数值
int e = 20;定义20元的数值
int s = 10;定义10元的数值
printf("please enter a even number for there: ");
scanf("%d",&n);
if(0 != n % 2){
printf("please enter a even number again");
}else{
int wl = n / w; //需要多少张五十元
int el = n / e; //需要多少张二十元
int sl = n / s; //需要多少张十元
for(;i <= wl;i++){
for(;j <= el;j++){
for(;k <= sl;k++){
if(n == wi+ej+s*k){
printf("五十元%d张,二十元%d张,十元%d张\n",i,j,k);
}
}
}
}
}
return 0;