Hab mal bissl im inet gesucht und bin auf das hier gestoßen:
# include <iostream.h>
# include <math.h>
# include <conio.h>
# include <stdlib.h>
# include <time.h>
//------------------------------------------------------------------------------
//Dekleration
void main (void)
{
int zahl [7];
randomize();
int CountArray [49];
int stat[50];
int ziehungen=0;
for (int i=0; i<50; i++) stat[i]=0;
int max;
int min;
do
{
ziehungen++ ;
for(int i = 0; i<7; i++)
{zahl[i]= rand()I+1;
for ( int j=0;j<i;j++)
{
if(zahl[i]==zahl[j])
{//gleich Zahl
i--;
}
}
}
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<"*********Super Lotto*******"<<endl;
cout<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<"----------------------------"<<endl;
cout<<"-------- ZIEHUNG: "<<ziehungen<<"---------"<<endl;
ziehungen+1;
cout<<"----------------------------"<<endl;
for(int i = 0;i<6;i++){ CountArray[zahl[i]-1]++;
stat [zahl[i]]++;
cout<<(i+1)<<" Zufalszahl ist: "<<zahl[i]<<" "<<endl;}
cout<<"----------------------------"<<endl;
cout<<"Zusatzzahl= "<<zahl[6]<<endl;
cout<<"----------------------------"<<endl;
cout<<"Programm wiederholen?"<<endl<<endl;
cout<<""<<endl;
cout<<endl;
cout<<endl;
} while (getch()!= 'n');
for (int i=1;i<50;i++)
{cout <<i<<"=>" << stat[i]<<endl;
getch();
}
getch();
}
weiss aber nicht obs geht... wie gesagt ist nicht von mir^^
Ergebnis 1 bis 10 von 26
Baum-Darstellung
-
18.06.2008, 19:36 #4Erfahrenes Mitglied Daddel König
- Registriert seit
- 22.12.2006
- Beiträge
- 759
- Beigetretene Turniere
- 0
- Turnier Siege
- 0
- Marktplatzbewertung
- 5 (100%)



Zitieren