Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void procedura (int strzaly[], int ilosc_strzalow, int n)
- {
- int*liczby;
- liczby=new int [n];
- for (int i=0; i<n; i++)
- {
- liczby[i]=i+1;
- }
- bool brak;
- for(int i=0; i<10; i++)
- {
- brak = true;
- for (int j=0; j<4; j++)
- {
- if (strzaly[j]==liczby[i])
- {
- brak = false;
- break;
- }
- }
- if (brak)
- {
- cout<<liczby[i]<<endl;
- }
- }
- delete []liczby;
- }
- int main()
- {
- int ile, ile_strzalow,n;
- cout<<"Podaj, ile liczb chcesz zgadnac"<<endl;
- cin>>ile_strzalow;
- int*strzaly;
- strzaly=new int [ile_strzalow];
- cout<<endl;
- for (int i=0; i<ile_strzalow; i++)
- {
- cout<<"Twoj strzal nr "<<i+1<<endl;
- cin>>strzaly[i];
- }
- cout<<endl;
- cout<<"Podaj zakres liczb: od 0 do... "<<endl;
- cin>>n;
- cout<<endl;
- procedura(strzaly, ile_strzalow, n);
- delete [] strzaly;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement