Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- int main()
- {
- std::vector<int> v;
- for(int i=1; i<=100; i++)
- {
- v.push_back(i*i);
- }
- auto pocetak=v.begin();
- auto iza_kraja=v.end();
- while(pocetak!=iza_kraja)
- {
- *pocetak%=42;
- pocetak++;
- }
- for(auto x:v)
- std::cout<<x<<" ";
- int broj;
- std::cout<<std::endl<<std::endl<<"Unesi broj: ";
- std::cin>>broj;
- std::cout<<std::endl;
- if(std::binary_search(std::begin(v), std::end(v), broj))
- std::cout<<"Broj se nalazi u bloku!";
- else
- std::cout<<"Broj se ne nalazi u bloku!";
- std::cout<<std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement