Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- bool JeLiTrocifren(int broj)
- {
- int counter(0), mojbroj(broj);
- while(mojbroj>0)
- {
- mojbroj/=10;
- counter++;
- }
- if(counter==3)
- return true;
- return false;
- }
- bool ImaTrocifrenih(std::vector<int> v)
- {
- for(unsigned int i(0); i < v.size(); i++)
- {
- if(JeLiTrocifren(v.at(i)))
- return true;
- }
- return false;
- }
- int main()
- {
- std::vector<int> test {1, 20, 300};
- std::cout << ImaTrocifrenih(test) << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment