Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- void uzupelnij(int tab[],int typ[]){
- srand(time(NULL));
- for (int i=0;i<6;i++){
- int a=1;
- int b=49;
- int s=a+rand()%(b-a+1);
- tab[i]=s;
- }
- for(int i=0;i<6;i++){
- cout<<"Podaj twoj typ dla "<<i+1<<" liczby: ";
- int a;
- cin >> a;
- typ[i]=a;
- }
- }
- sprawdz(int tab[], int typ[]){
- for(int i=0;i<6;i++){
- if(tab[i]==typ[i]){
- cout<<"Brawo liczba numer "<<i+1<<" sie zgadza, wynosi ona "<<tab[i]<<endl;
- }
- else{
- cout<<"Oj oj, liczba numer "<<i+1<<" sie nie zgadza, wynosi ona "<<tab[i]<<endl;
- }
- }
- }
- int main()
- {
- int tablica[6];
- int typ[6];
- uzupelnij(tablica,typ);
- sprawdz(tablica,typ);
- return 0;
- }
Add Comment
Please, Sign In to add comment