Files
kombi/kombinationen.cc
2017-02-07 20:07:34 +00:00

41 lines
561 B
C++

//Program Kombinantionen
#include <stdio.h>
#include <iostream.h>
#include <string.h>
//#define DEBUG
int n=0; // Anzahl Schleifen
char Eingabe[100];
char Ausgabe[100];
void ForS(char* theEingabe, int Ebene)
{
char i;
int k;
if (Ebene < n) {
for (i=0;i<strlen(theEingabe);i++){
Ausgabe[Ebene] = Eingabe[i];
ForS(Ebene+1);
}
}
else
{
for(k=0;k<=n-1;k++){
cout << Ausgabe[k] ;
}
cout << endl;
}
}
void main(void)
{
cout << "Wort:";
cin >> Eingabe;
n = strlen(Eingabe) ;
ForS(Eingabe,0);
}