fork(1) download
  1. #include <stdio.h>
  2. #include<string.h>
  3. int main()
  4. {
  5. long long int j,c,t,length;
  6. char s[100];
  7. scans("%lld",&t);
  8. for(j=0;j<t;j++)
  9. {scanf("%s",s);
  10. length=strlen(s);
  11. c=0;
  12. long long int i ;
  13. long long int num1 = 0,num2 = 0;
  14. long long int location = 0;
  15.  
  16. for(i = 0; i< length - 1; ++i)
  17. {
  18. if(s[i] == s[i+1])
  19. ++num2;
  20. {
  21. if(num2 >num1)
  22. { num1 = num2;location = i - num2;}
  23. else
  24.  
  25. num2 = 0;
  26. }
  27. }
  28.  
  29. for(i = location;s[i]== s[num1];++i)
  30. {c++;}
  31. printf("%lld\n",c);
  32. }
  33. return 0;
  34. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
1
daiict
compilation info
prog.c: In function ‘main’:
prog.c:7:1: warning: implicit declaration of function ‘scans’ [-Wimplicit-function-declaration]
 scans("%lld",&t);
 ^~~~~
/home/nvsz86/ccdAS7bA.o: In function `main':
prog.c:(.text.startup+0x18): undefined reference to `scans'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty