[ create a new paste ] login | about

Link: http://codepad.org/di99g3Mw    [ raw code | output | fork | 1 comment ]

C, pasted on Jun 6:
/*
 >> 3 4

 1+1+1+1,
 1+1+2,
 1+2+1,
 1+3,
 2+1+1,
 2+2,
 3+1,

 << 7
*/

int main() 
{
 int i,j,s,a=3,b=4;

 for(i=1;i<b;i++) 
 {
  s=0;
  for(j=0;;j++) {
   if((s+=i) > a+1) break;
   printf ("%d ", i);
  }
  puts("");
 }

 return 0;
}


Output:
1
2
3
1 1 1 1 
2 2 
3 


Create a new paste based on this one


Comments:
posted by esomboy on Jun 6

reply