Witam, robię prymitywnego totolotka i po 1. chcialbym zapytac jak zrobic, by kazda liczba byla inna, bo nieraz sie zdarza, ze 2 takie same sa. Po 2. chce zrobic tablice, ktora na koncu by pokazywala ile liczb trafilem.
Z gory dziekuje :}
#include <iostream>
#include <windows.h>
#include <cstdlib>
#include <cstdio>
#include <time.h>
using namespace std;
int liczba,l1,l2,l3,l4,l5,l6,s1,s2,s3,s4,s5,s6, tablica ;
int main()
{
cout<<"Podaj 6 liczb z przedzialu 1-49: "<<endl;
cout<<"Podaj 1 liczbe: ";
cin>>s1;
cout<<"Podaj 2 liczbe: ";
cin>>s2;
cout<<"Podaj 3 liczbe: ";
cin>>s3;
cout<<"Podaj 4 liczbe: ";
cin>>s4;
cout<<"Podaj 5 liczbe: ";
cin>>s5;
cout<<"Podaj 6 liczbe: ";
cin>>s6;
cout<<endl;
srand(time(NULL));
l1 = rand()%49+1;
cout<<l1<<endl;
l2 = rand()%49+1;
cout<<l2<<endl;
l3 = rand()%49+1;
cout<<l3<<endl;
l4 = rand()%49+1;
cout<<l4<<endl;
l5 = rand()%49+1;
cout<<l5<<endl;
l6 = rand()%49+1;
cout<<l6<<endl;
if(s1,s2,s3,s4,s5,s6==l1,l2,l3,l4,l5,l6)
{
cout<<"trafiles";
}
return 0;
}