Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool Fja (int n)
- { if (n<=0) throw "N mora biti pozitivno! ";
- vector<int> pom(0);
- while (n!=0) {
- pom.push_back(n%10);
- n/=10;
- }
- for (int i=0; i<pom.size()-1;i++) {
- for (int j=i+1; j<pom.size(); j++)
- {
- if (pom[i]==pom[j]) return true;
- } }
- return false;
- }
- int main () {
- int n{345699};
- try {
- bool rez=Fja(n);
- cout<<rez;
- }
- catch (const char por[])
- {
- cout<<por;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement