# include
# include
//Dieses Programm sortiert sieben eingegebene Lottozahlen voll automatisch
void main ()
{
const int anzahl=6;
float zahlen[anzahl],zwischenspeicher;
int j,index;
//Sprungmarke
top:
coutcoutcout
//Einlesen der Zahlen
for (index=0;index{
coutcin>> zahlen[index];
if (zahlen[index]>49)
{coutgoto top;}
else
{
if (zahlen[index]{coutgoto top;}
}
}
//Ausgabe eingegebener Zahlen
coutcoutcoutfor (index=0;index{
cout}
//Aeussere for-Schleife
for (j=anzahl;j>=2;j--)
{
//Innere for-Schleife
for(index=0;index{
if(zahlen[index]>zahlen[index+1])
{
zwischenspeicher=zahlen[index];
zahlen[index]=zahlen[index+1];
zahlen[index+1]=zwischenspeicher;
}
}//Ende Innere for-Schleife
}//Ende Aeussere for-Schleife
//Ausgabe sortierte Zahlen
coutcoutcoutfor(index=0;index{
cout}
getch ();
}