Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int main()
- {
- int a=1,b=49,c=0;
- int lotto[6];
- int liczby[6];
- srand(time(NULL));
- for(int i=0;i<6;i++)
- {
- lotto[i]=a+rand()%(b-a+1);
- }
- cout << " Podaj swoje typy liczb \n";
- for(int i=0;i<6;i++)
- {
- cout << i+1 << " Liczba: ";
- cin >> liczby[i];
- }
- for(int i=0;i<6;i++)
- {
- for(int j=0;j<6;j++)
- {
- if(liczby[i]==lotto[j])
- {
- c=c+1;
- }
- }
- }
- cout << "Gratulacje, odgadles " << c << " liczb";
- return 0;
- }
Add Comment
Please, Sign In to add comment