Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int cifre(int n,int c)
- {
- int k=0;
- while(n)
- {
- if(n%10==c)
- k++;
- n/=10;
- }
- return k;
- }
- int main()
- {
- int x,cop,ok;
- ifstream f("date.in");
- ofstream g("date.out");
- while(f>>x)
- {
- cop=x;
- ok=1;
- while(cop>9)
- {
- if(cifre(cop/10,cop%10)!=0)
- ok=0;
- cop/=10;
- }
- if(ok)
- g<<x<<" ";
- }
- f.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement