Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<ctime>
- #include<cmath>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- int a=0;
- cout<<"wybierz co chcesz zrobic"<<endl;
- cout<<"1 w poszukiwaniu papaja "<<endl;
- cout<<"2 2137*JP2GMD"<<endl;
- cin>>a;
- switch(a)
- {
- case 1:
- srand(time(NULL));
- int tab[2137];
- int l=0;
- int i=0;
- int p=0;
- for (i=0; i<2137; i++)
- {
- tab[i]={rand()%2138};
- cout<<"miejsce "<<i+1<<" "<<tab[i]<<endl;
- cout<<"JP2GMD"<<endl;
- if (tab[i]%2==0)
- {
- l++;
- }
- if(tab[i]==2137)
- {
- p=i+1;
- }
- }
- cout<<l<<" oto ilośc parzystych"<<endl;
- if(p>0)
- cout<<"PAPIESZ JEST NA "<<p << " MIEJSCU"<<endl;
- else
- cout<<"NIE MA PAPIESZA"<<endl;
- break;
- case 2:
- int k=0;
- for (k=0;k<2137;k++)
- {
- cout<<k+1<<" JP2GMD"<<endl;
- }
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment