Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void)
- {
- char ch;
- int cnt=0, max=0, res;
- while(1)
- {
- res = scanf("%c", &ch);
- if (res == -1) break;
- if((ch==10)||(ch==13))
- {
- if(cnt>max) max = cnt;
- cnt=0;
- }
- else cnt++;
- }
- printf("가장 긴 단어의 길어 : %d\n", max);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement