Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <cmath>
- bool ImaLiPotpunihKvadrata(std::vector<int> v)
- {
- for(unsigned int i(0); i<v.size(); i++)
- {
- if(sqrt(v.at(i)) == int(sqrt(v.at(i))))
- return true;
- }
- return false;
- }
- int main()
- {
- std::vector<int> test {2, 81, 10};
- std::cout << ImaLiPotpunihKvadrata(test) << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment