Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- { int n,x=0,ct=0;
- cout<<"Introdu numarul dorit: ";
- cin>>n;
- cout<<"Introdu cifra dorita: "<<endl;
- cin>>x;
- while(n>0)
- {
- if(n%10==x)
- ct=ct+1;
- n=n/10;
- }
- if(ct>1)
- cout<<"Cifra se repeta de"<<" "<<ct<<" "<<"ori.";
- if(ct==1)
- cout<<"Cifra se gaseste o singura data.";
- if(ct==0)
- cout<<"Cifra nu exista in numar.";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement