Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <string.h>
- #define N 1000
- int main() {
- int lmax;
- int l;
- char smax[5];
- char s[N+1];
- lmax=0;
- while (scanf("%1000s", s) == 1)
- {
- s[N] = '\0';
- l = strlen (s);
- if (l > lmax)
- {
- lmax = l;
- strcpy (smax,s);
- }
- printf("+++%s+++ %d\n", s, l);
- };
- //printf("hello world");
- printf("%s %d", smax, lmax);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement