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