谢谢各位了,俺自己也会拉!
#include<stdio.h>
#include<math.h>
main()
{int a,b,c,x,y,i=0,j=0;
int fen_1=1,fen_2=2,fen_5=5;
for(a=0;a<=100;a++)
{x=100-a*fen_1;
for(b=0;b<=50;b++)
{y=x-b*fen_2;
if(y<0) continue;
if(y%fen_5!=0) continue;
c=y/fen_5;
i=i+1;
j=j+1;
printf("%d,%d,%d\t",a,b,c);
if(i%5==0) printf("\n");
}
}
printf("\n%d\n",j);
getch();
}