10rch

Untitled

Mar 27th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.   char s[50];
  6.   int i,j,n,max=0,maxch=0,now=0,num=0,c;
  7.   while((c=getchar())!=EOF){
  8.     n++;
  9.    for(i=0;i<n;i++);{
  10.     s[i]=c;
  11.    }
  12.    for(j=0;j<n;j++){
  13.     if(s[j]==s[i]){
  14.       num++;
  15.       now=s[j];
  16.       if(num>max){
  17.         maxch=now;
  18.         max=num;
  19.       }
  20.       if(j++){
  21.         num=0;
  22.       }
  23.     }
  24.   }
  25.  }
  26.  printf("%c\n",maxch);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment