Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream.h>
- #include<conio.h>
- int nr(long int &n,int c)
- { int k=0;
- while(n>0)
- { if(n%10==c)k++;
- }
- n=k;
- }
- void main()
- { clrscr();
- int i;
- long int n,nr;
- int k=0;
- cout<<"n=";cin>>n;
- nr=n;
- for(i=0;i<=9;i++)
- { n=nr;
- nr(n,i);
- if(n==1)k++;
- }
- cout<<k;
- getch();
- }
Add Comment
Please, Sign In to add comment