Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- int main()
- {
- char tab[1001];
- int temp = 0;
- int max = 0;
- scanf("%1000[^n]", tab);
- for(int i = 0; i < strlen(tab); i++) {
- if(isalpha(tab[i])) {
- temp++;
- }
- else if(max < temp) { max = temp; temp = 0; }
- else temp = 0;
- }
- temp = 0;
- printf("%d\n", max);
- /*
- for(int i = 0; i < strlen(tab); i++) {
- if(isalpha(tab[i])) {
- temp++;
- printf("%d\n", temp);
- }
- else if(max == temp) {
- for(int j = 0; j < max; j++) printf("%c", tab[i - max + i]);
- printf("\n");
- temp = 0;
- }
- else temp = 0;
- }
- */
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement