language: C (gcc-4.3.4)
date: 108 days 1 hour ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<stdio.h>
#include<string.h>
char str[20000];
int extract(int a)
{
 int len=0;
 while(str[a]!=' ') len++;
 return len;
}
 
main()
{
 int t;
 scanf("%d",&t);
 while(t--)
{
 scanf("%s",str);
 i=0;
 max=0,count=1;
 len=extract(i);
 while((i+20)<=strlen(str))
 {
 i=len+1;
  if(len==extract(i)) {  count++; }
  else { len=extract(i); }
  if(count>max) max=count;
 }
printf("%d\n",max);
}
return 0;
}
prog.c:12: warning: return type defaults to ‘int’
prog.c: In function ‘main’:
prog.c:18: error: ‘i’ undeclared (first use in this function)
prog.c:18: error: (Each undeclared identifier is reported only once
prog.c:18: error: for each function it appears in.)
prog.c:19: error: ‘max’ undeclared (first use in this function)
prog.c:19: error: ‘count’ undeclared (first use in this function)
prog.c:19: warning: left-hand operand of comma expression has no effect
prog.c:20: error: ‘len’ undeclared (first use in this function)
prog.c:14: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result
prog.c:17: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result