Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- bool funkc (int broj){
- int cifra;
- std::vector<int> v;
- while (broj!=0)
- {
- cifra=broj%10;
- v.push_back(cifra);
- broj=broj/10;
- }
- int J(0);
- bool imaistih=false;
- for (int i=1; i<v.size(); i++)
- {
- for (int j=1; j<v.size(); j++)
- {
- if (v[i]==v[j])
- J++;
- }
- }
- if (J>1)
- imaistih=true;
- return imaistih;
- }
- int main()
- {
- int broj;
- std::cout << "unesite broj ";
- std::cin >> broj;
- std::cout << funkc(broj);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment