网友要的单元加的小程序
#include "stdio.h"int num(int number,int i)
{
int k,n=number;
if(i==0)
return 1;
if(num(number,i-1))
{
while(n>i)
{
n=n-i;
if((n+i)!=number)
{
for(k=0;number-k>n;k=k+i)
printf("%d+",i);
printf("%d\n",n);
}
else
printf("%d+%d\n",i,n);
}
return 1;
}
}
void main()
{
int m,n;
printf("input m:");
scanf("%d",&m);
printf("input n:");
scanf("%d",&n);
num(m,n);
}