Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, cifmax=-1, uc, nr;
- cin>>n;
- if(n==0)
- {
- cifmax=0;
- nr=1;
- }
- while(n)
- {
- uc=n%10;
- if(uc>cifmax)
- {
- cifmax=uc;
- nr=1;
- }
- else if(uc==cifmax)
- nr++;
- n=n/10;
- }
- cout<<cifmax<<" "<<nr;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement