avukas

5* (2zsr)

Mar 12th, 2014
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 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=0; i<v.size(); i++)
  18. {
  19. if (v[0]==v[i])
  20. J++;
  21.  
  22. }
  23. if (J>=1)
  24. imaistih=true;
  25. return imaistih;
  26. }
  27.  
  28.  
  29. int main()
  30. {
  31. int broj;
  32. std::cout << "unesite broj ";
  33. std::cin >> broj;
  34. std::cout << funkc(broj);
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment