G
Guest
Gość
Jeli ktos wie co jest nie tak w tym kodzie to hmmm prosze odpowiedz
to wazne :::
chodzi mi tu konkretnie zeby za kazdym razem program od nowa generowal losowe liczby.....
//#include <vclcondefs.h>
//#include <stdio.h>
#include <stdlib.h>
//#include <string.h>
#include <iostream.h>
#include <conio.h>
#include <fstream.h>
main()
{
newgame:
int a,b,c,d,e,f;
clrscr();
randomize();
cout << "Jestem symulatorem popularnej gry liczbowej nI chce Ci pokazac jakie masz szanse na wygrana"<< endl;
cout << "Wybierz 6 liczb od 1 do 49" << endl;
cout << "Liczba 1:::" ;
cin >> a;
cout << "Liczba 2:::" ;
cin >> b;
cout << "Liczba 3:::" ;
cin >> c;
cout << "Liczba 4:::" ;
cin >> d;
cout << "Liczba 5:::" ;
cin >> e;
cout << "Liczba 6:::" ;
cin >> f;
cout << " " << endl;
if (a>49)
goto newgame;
if (b>49)
goto newgame;
if (c>49)
goto newgame;
if (d>49)
goto newgame;
if (e>49)
goto newgame;
if (f>49)
goto newgame;
if (a==
goto newgame;
if (a==c)
goto newgame;
if (a==d)
goto newgame;
if (a==e)
goto newgame;
if (a==f)
goto newgame;
if (b==a)
goto newgame;
if (b==c)
goto newgame;
if (b==d)
goto newgame;
if (b==e)
goto newgame;
if (b==f)
goto newgame;
if (c==a)
goto newgame;
if (c==
goto newgame;
if (c==d)
goto newgame;
if (c==e)
goto newgame;
if (c==f)
goto newgame;
if (d==a)
goto newgame;
if (d==
goto newgame;
if (d==c)
goto newgame;
if (d==e)
goto newgame;
if (d==f)
goto newgame;
if (e==a)
goto newgame;
if (e==
goto newgame;
if (e==c)
goto newgame;
if (e==d)
goto newgame;
if (e==f)
goto newgame;
if (f==a)
goto newgame;
if (f==
goto newgame;
if (f==c)
goto newgame;
if (f==d)
goto newgame;
if (f==e)
goto newgame;
cout << "ile razy mam losowacn" ;
int wyb ;
cin >> wyb ;
cout << "To twoje liczby" <<endl;
cout << "Wcisnij Enter aby komputer zaczol losowanie!"<<endl;
cout << "" << endl;
getch();
for (int i = 0 ;i!=wyb;i++)
{
randomize();
random:
int a2 = random(49) ;
int b2 = random(49) ;
int c2 = random(49) ;
int d2 = random(49) ;
int e2 = random(49) ;
int f2 = random(49) ;
if (a2==b2)
goto random;
else if (a2==c2)
goto random;
else if (a2==d2)
goto random;
else if (a2==e2)
goto random;
else if (a2==f2)
goto random;
if (b2==a2)
goto random;
else if (b2==c2)
goto random;
else if (b2==d2)
goto random;
else if (b2==e2)
goto random;
else if (b2==f2)
goto random;
if (c2==a2)
goto random;
else if (c2==b2)
goto random;
else if (c2==d2)
goto random;
else if (c2==e2)
goto random;
else if (c2==f2)
goto random;
if (d2==a2)
goto random;
else if (d2==b2)
goto random;
else if (d2==c2)
goto random;
else if (d2==e2)
goto random;
else if (d2==f2)
goto random;
if (e2==a2)
goto random;
else if (e2==b2)
goto random;
else if (e2==c2)
goto random;
else if (e2==d2)
goto random;
else if (e2==f2)
goto random;
if (f2==a2)
goto random;
else if (f2==b2)
goto random;
else if (f2==c2)
goto random;
else if (f2==d2)
goto random;
else if (f2==e2)
goto random;
cout << "Liczba 7:::" << a2 <<endl;
cout << "Liczba 8:::" << b2 <<endl;
cout << "Liczba 9:::" << c2 <<endl;
cout << "Liczba 10:::" << d2 <<endl;
cout << "Liczba 11:::" << e2 <<endl;
cout << "Liczba 12:::" << f2 <<endl;
int x=0;
if (a==a2)
x++;
else if (a==b2)
x++;
else if (a==c2)
x++;
else if (a==d2)
x++;
else if (a==e2)
x++;
else if (a==f2)
x++;
if (b==a2)
x++;
else if (b==b2)
x++;
else if (b==c2)
x++;
else if (b==d2)
x++;
else if (b==e2)
x++;
else if (b==f2)
x++;
if (c==a2)
x++;
else if (c==b2)
x++;
else if (c==c2)
x++;
else if (c==d2)
x++;
else if (c==e2)
x++;
else if (c==f2)
x++;
if (d==a2)
x++;
else if (d==b2)
x++;
else if (d==c2)
x++;
else if (d==d2)
x++;
else if (d==e2)
x++;
else if (d==f2)
x++;
if (e==a2)
x++;
else if (e==b2)
x++;
else if (e==c2)
x++;
else if (e==d2)
x++;
else if (e==e2)
x++;
else if (e==f2)
x++;
if (f==a2)
x++;
else if (f==b2)
x++;
else if (f==c2)
x++;
else if (f==d2)
x++;
else if (f==e2)
x++;
else if (f==f2)
x++;
cout << "Trafionych liczb:" << x << endl;
}
getch();
}
to wazne :::
chodzi mi tu konkretnie zeby za kazdym razem program od nowa generowal losowe liczby.....
//#include <vclcondefs.h>
//#include <stdio.h>
#include <stdlib.h>
//#include <string.h>
#include <iostream.h>
#include <conio.h>
#include <fstream.h>
main()
{
newgame:
int a,b,c,d,e,f;
clrscr();
randomize();
cout << "Jestem symulatorem popularnej gry liczbowej nI chce Ci pokazac jakie masz szanse na wygrana"<< endl;
cout << "Wybierz 6 liczb od 1 do 49" << endl;
cout << "Liczba 1:::" ;
cin >> a;
cout << "Liczba 2:::" ;
cin >> b;
cout << "Liczba 3:::" ;
cin >> c;
cout << "Liczba 4:::" ;
cin >> d;
cout << "Liczba 5:::" ;
cin >> e;
cout << "Liczba 6:::" ;
cin >> f;
cout << " " << endl;
if (a>49)
goto newgame;
if (b>49)
goto newgame;
if (c>49)
goto newgame;
if (d>49)
goto newgame;
if (e>49)
goto newgame;
if (f>49)
goto newgame;
if (a==
goto newgame;
if (a==c)
goto newgame;
if (a==d)
goto newgame;
if (a==e)
goto newgame;
if (a==f)
goto newgame;
if (b==a)
goto newgame;
if (b==c)
goto newgame;
if (b==d)
goto newgame;
if (b==e)
goto newgame;
if (b==f)
goto newgame;
if (c==a)
goto newgame;
if (c==
goto newgame;
if (c==d)
goto newgame;
if (c==e)
goto newgame;
if (c==f)
goto newgame;
if (d==a)
goto newgame;
if (d==
goto newgame;
if (d==c)
goto newgame;
if (d==e)
goto newgame;
if (d==f)
goto newgame;
if (e==a)
goto newgame;
if (e==
goto newgame;
if (e==c)
goto newgame;
if (e==d)
goto newgame;
if (e==f)
goto newgame;
if (f==a)
goto newgame;
if (f==
goto newgame;
if (f==c)
goto newgame;
if (f==d)
goto newgame;
if (f==e)
goto newgame;
cout << "ile razy mam losowacn" ;
int wyb ;
cin >> wyb ;
cout << "To twoje liczby" <<endl;
cout << "Wcisnij Enter aby komputer zaczol losowanie!"<<endl;
cout << "" << endl;
getch();
for (int i = 0 ;i!=wyb;i++)
{
randomize();
random:
int a2 = random(49) ;
int b2 = random(49) ;
int c2 = random(49) ;
int d2 = random(49) ;
int e2 = random(49) ;
int f2 = random(49) ;
if (a2==b2)
goto random;
else if (a2==c2)
goto random;
else if (a2==d2)
goto random;
else if (a2==e2)
goto random;
else if (a2==f2)
goto random;
if (b2==a2)
goto random;
else if (b2==c2)
goto random;
else if (b2==d2)
goto random;
else if (b2==e2)
goto random;
else if (b2==f2)
goto random;
if (c2==a2)
goto random;
else if (c2==b2)
goto random;
else if (c2==d2)
goto random;
else if (c2==e2)
goto random;
else if (c2==f2)
goto random;
if (d2==a2)
goto random;
else if (d2==b2)
goto random;
else if (d2==c2)
goto random;
else if (d2==e2)
goto random;
else if (d2==f2)
goto random;
if (e2==a2)
goto random;
else if (e2==b2)
goto random;
else if (e2==c2)
goto random;
else if (e2==d2)
goto random;
else if (e2==f2)
goto random;
if (f2==a2)
goto random;
else if (f2==b2)
goto random;
else if (f2==c2)
goto random;
else if (f2==d2)
goto random;
else if (f2==e2)
goto random;
cout << "Liczba 7:::" << a2 <<endl;
cout << "Liczba 8:::" << b2 <<endl;
cout << "Liczba 9:::" << c2 <<endl;
cout << "Liczba 10:::" << d2 <<endl;
cout << "Liczba 11:::" << e2 <<endl;
cout << "Liczba 12:::" << f2 <<endl;
int x=0;
if (a==a2)
x++;
else if (a==b2)
x++;
else if (a==c2)
x++;
else if (a==d2)
x++;
else if (a==e2)
x++;
else if (a==f2)
x++;
if (b==a2)
x++;
else if (b==b2)
x++;
else if (b==c2)
x++;
else if (b==d2)
x++;
else if (b==e2)
x++;
else if (b==f2)
x++;
if (c==a2)
x++;
else if (c==b2)
x++;
else if (c==c2)
x++;
else if (c==d2)
x++;
else if (c==e2)
x++;
else if (c==f2)
x++;
if (d==a2)
x++;
else if (d==b2)
x++;
else if (d==c2)
x++;
else if (d==d2)
x++;
else if (d==e2)
x++;
else if (d==f2)
x++;
if (e==a2)
x++;
else if (e==b2)
x++;
else if (e==c2)
x++;
else if (e==d2)
x++;
else if (e==e2)
x++;
else if (e==f2)
x++;
if (f==a2)
x++;
else if (f==b2)
x++;
else if (f==c2)
x++;
else if (f==d2)
x++;
else if (f==e2)
x++;
else if (f==f2)
x++;
cout << "Trafionych liczb:" << x << endl;
}
getch();
}