All pastes #389068 Raw Edit

Anonymous

public cpp v1 · immutable
·published 2007-03-10 14:26 UTC
rendered paste body
#include <stdio.h>#include <stdlib.h>#include <conio.h>void printArray(int a[], int len);int main(){    int num[]={5, 4, 3, 2, 1},        soch[]={3, 2, 1};	int s = 0, numLen = 5, sochLen = 3, i=0, j=0;	while(s<10)	{		printArray(soch, sochLen);		i=0;		while(num[i] == soch[i])i++;		soch[i]++;		if(i!=0)			for(j=i;j>=0;j--)				soch[j-1] = soch[j]+1;		s++;    }	return 0;}void printArray(int a[], int len){	int i=0;	for(i=len-1;i>=0;i--)		printf((i==0)?"%d\n":"%d ", a[i]);}