avukas

Untitled

Mar 12th, 2014
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3.  
  4. bool funkc (int broj){
  5.  
  6. int cifra;
  7. std::vector<int> v;
  8.  
  9. while (broj!=0)
  10. {
  11. cifra=broj%10;
  12. v.push_back(cifra);
  13. broj=broj/10;
  14. }
  15. int J(0);
  16. bool imaistih=false;
  17. for (int i=1; i<v.size(); i++)
  18. {
  19. for (int j=1; j<v.size(); j++)
  20. {
  21. if (v[i]==v[j])
  22. J++;
  23. }
  24.  
  25. }
  26.  
  27. if (J>1)
  28. imaistih=true;
  29. return imaistih;
  30. }
  31.  
  32.  
  33. int main()
  34. {
  35. int broj;
  36. std::cout << "unesite broj ";
  37. std::cin >> broj;
  38. std::cout << funkc(broj);
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment