#include int cnt=0; void pm( int a, int b, char str[1000] ) { if( a>b ) a=b; char strN[1000]=""; for(int c=a; c>=1; c-- ) { //todo if( b-c == 0 ) { printf( "%s%d\n", str, c ); }else { sprintf( strN, "%s%d+", str, c ); pm( c, b-c, strN ); } } } void main() { printf("aloha\n"); char strN[1000] = ""; pm( 10, 10, strN ); }