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, ilosc=0;
- int lotto[8];
- int liczby[8];
- srand(time(NULL));
- for(int i=0; i<8; i++){
- lotto[i]=a+rand()%(b-a+1);
- }
- cout << "Podaj swoje typy liczb: " << endl << endl;
- for(int i=0; i<8; i++){
- cout << i+1 << " liczba: ";
- cin >> liczby[i];
- }
- for(int i=0; i<8; i++){
- for(int j=0; j<8; j++){
- if(liczby[i]==lotto[j]){
- ilosc=ilosc+1;
- }
- }
- }
- cout << endl << "Gratulacje! Odgadles " << ilosc << "/8 liczb";
- return 0;
- }
Add Comment
Please, Sign In to add comment