initial checkin from subversion
This commit is contained in:
40
kombinationen.cc
Normal file
40
kombinationen.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
//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);
|
||||
}
|
||||
Reference in New Issue
Block a user