Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <time.h>
- #include <cstdlib>
- using namespace std;
- int main()
- { int x;
- cout << "Losowanko: Podaj 6 liczb z zakresu od 1-49 aby sprawdzic czy cos ugrales" << endl;
- int los[6];
- int typ[6];
- for(int i=0; i<6; i++){
- cin>>x;
- typ[i]=x;
- }
- srand(time(NULL));
- for(int i=0; i<6; i++){
- los[i]=rand()%49+1;
- }
- for(int i=0; i<6; i++){
- for(int j=0; j<6; j++){
- if(typ[j]==los[i]){
- cout<<"Gratulacje! Trafiles liczbe: "<<los[i];
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment