Josif_tepe

Untitled

Apr 25th, 2026
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4.   int  n;
  5.     cin>>n;
  6.     int niza[10]={0};
  7.     while(n>0){
  8.         int cifra=n%10;
  9.         n/=10;
  10.         if(cifra==6 or cifra==9){
  11.             niza[6]++;
  12.         }
  13.         else{
  14.             niza[cifra]++;
  15.         }
  16.     }
  17. niza[6]=(niza[6]+1)/2;
  18. int m=0;
  19. for(int i=0; i<=9; i++){
  20.     m=max(m,niza[i]);
  21. }
  22. cout<<m;
  23.     return 0;
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment