Home > Back-end >  Enter a string in English (the length of the string will be limited to 200 characters), only with on
Enter a string in English (the length of the string will be limited to 200 characters), only with on

Time:12-02

Great god help me look at my code have any logic problems

# include "stdio.h"
# include "string. H"
Int main () {
char a[200];
Int I=0, j=0, len, maxlen=1, maxst;
gets(a);
Len=strlen (a);
for (i=0; i <=len; I++) {
If (a [I]=='\ 0')
break;
Else if (a [I]!=' ')
j++;
The else {the if (j> Maxlen) {
Maxlen=j;
Maxst=I - j;
J=0;
A [I]='\ 0';
}
}
}
Puts (& amp; A [maxst]);
Printf (" % d ", maxlen);
}
  • Related