fork download
  1. #include <stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5. long long int j,c;
  6. char s[100];
  7. for(j=0;j<t;j++)
  8. {scanf("%s",s);
  9. c=0;
  10. long long int i ;
  11. long long int num1 = 0,num2 = 0;
  12. long long int location = 0;
  13.  
  14. for(i = 0; i< length - 1; ++i)
  15. {
  16. if(s[i] == s[i+1])
  17. ++num2;
  18. {
  19. if(num2 >num1)
  20. { num1 = num2;location = i - num2;}
  21. else
  22.  
  23. num2 = 0;
  24. }
  25. }
  26.  
  27. for(i = location;s[i]== s[num1];++i)
  28. {c++;}
  29. printf("%lld\n",c);
  30. }
  31. return 0;
  32. }
  33.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
1
daiict
compilation info
prog.c: In function ‘main’:
prog.c:7:13: error: ‘t’ undeclared (first use in this function)
   for(j=0;j<t;j++)
             ^
prog.c:7:13: note: each undeclared identifier is reported only once for each function it appears in
prog.c:14:23: error: ‘length’ undeclared (first use in this function)
         for(i = 0; i< length - 1; ++i)
                       ^~~~~~
stdout
Standard output is empty