Zitat:
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int Richtige = 0;
int Zufall[7];
int Tipp[7];
int e;
int w = 0;
int i;
int h = 0;
for(i=0; i<7; i++)
{
Zufall[i]=rand()%50;
cout << Zufall[i] << endl;
}
for (e=0; e<7; e++)
{
cout << "Bitte geben die ihre " << e << ". Zahl ein:\t";
cin >> Tipp[e];
}
for(w=0; w<7; i++)
{
for(h=0; h<7; h++)
{
if( Zufall[w] == Tipp[h] )
{
Richtige++;
}
}
}
cout << "Sie haben " << Richtige << " Richtige!" << endl;
fflush(stdin);
getchar();
return 0;
}