Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- char s[50];
- int i,j,n,max=0,maxch=0,now=0,num=0,c;
- while((c=getchar())!=EOF){
- n++;
- for(i=0;i<n;i++);{
- s[i]=c;
- }
- for(j=0;j<n;j++){
- if(s[j]==s[i]){
- num++;
- now=s[j];
- if(num>max){
- maxch=now;
- max=num;
- }
- if(j++){
- num=0;
- }
- }
- }
- }
- printf("%c\n",maxch);
- }
Advertisement
Add Comment
Please, Sign In to add comment