Mein programm sieht so aus:
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <time.h>
#include <dos.h>
#define MAX 7
int x[6];
void Sortieren1 (void);
main()
{
int a,n;
randomize(); //Intialisierung- 1Mal
for (a=0;a<MAX;a++)
{
x[a]=random (49)+1 ;
for (n=0;n<MAX;n++);
}
Sortieren1 ();
cout<<x[0]<<endl;
cout<<x[1]<<endl;
cout<<x[2]<<endl;
cout<<x[3]<<endl;
cout<<x[4]<<endl;
cout<<x[5]<<endl;
getch();
}
void Sortieren1 (void)
{
int i,hilf,unsortiert;
do
{
unsortiert=0;
for ( i=0; i<MAX; i++)
if ( x > x[i+1] )
{ hilf = x ;
x = x[i+1] ;
x[i+1] = hilf;
unsortiert=1;
}
}
while ( unsortiert );
} // Sortieren1
dieses will so ändern, statt der generator mir 6 zahlen schmeisst sondern das ich die zahlen manuell 1-6 selber eingebe, und der zufalls generator gibt aus wieviel richtige ich habe oder wieviel mal ich spielen soll damit ich 6 richtige habe.
Danke für eure Antworten:)
Gruß
kanka73