Language: C

main(){
  int i,n=0,q=0,c[512],a=0,b=0;
  char s[1024],t[512][32],*p;
  fgets(s,1024,stdin);
  for(;;){
    p=strchr(s+q,' ');
    if(!p)
      p=s+strlen(s)-1;
    strncpy(t[n],s+q,p-s-q);
    for(i=0;i<n;i++)
      if(strcmp(t[i],t[n])==0){
	c[i]++;
	break;
      }
    if(i==n){
      c[i]=1;
      n++;
    }
    q=p-s+1;
    if(p==s+strlen(s)-1)
      break;
  }
  for(i=1;i<n;i++){
    if(c[i]>c[a])
      a=i;
    if(strlen(t[i])>strlen(t[b]))
      b=i;
  }
  printf("%s %s\n",t[a],t[b]);
  return 0;
}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(){
      | ^~~~
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration]
    4 |   fgets(s,1024,stdin);
      |   ^~~~~
main.c:4:16: error: 'stdin' undeclared (first use in this function)
    4 |   fgets(s,1024,stdin);
      |                ^~~~~
main.c:1:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
  +++ |+#include <stdio.h>
    1 | main(){
main.c:4:16: note: each undeclared identifier is reported only once for each function it appears in
    4 |   fgets(s,1024,stdin);
      |                ^~~~~
main.c:6:7: error: implicit declaration of function 'strchr' [-Wimplicit-function-declaration]
    6 |     p=strchr(s+q,' ');
      |       ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strchr'
  +++ |+#include <string.h>
    1 | main(){
main.c:6:7: warning: incompatible implicit declaration of built-in function 'strchr' [-Wbuiltin-declaration-mismatch]
    6 |     p=strchr(s+q,' ');
      |       ^~~~~~
main.c:6:7: note: include '<string.h>' or provide a declaration of 'strchr'
main.c:8:11: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
    8 |       p=s+strlen(s)-1;
      |           ^~~~~~
main.c:8:11: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:8:11: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
main.c:8:11: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:9:5: error: implicit declaration of function 'strncpy' [-Wimplicit-function-declaration]
    9 |     strncpy(t[n],s+q,p-s-q);
      |     ^~~~~~~
main.c:9:5: note: include '<string.h>' or provide a declaration of 'strncpy'
main.c:9:5: warning: incompatible implicit declaration of built-in function 'strncpy' [-Wbuiltin-declaration-mismatch]
main.c:9:5: note: include '<string.h>' or provide a declaration of 'strncpy'
main.c:11:10: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
   11 |       if(strcmp(t[i],t[n])==0){
      |          ^~~~~~
main.c:11:10: note: include '<string.h>' or provide a declaration of 'strcmp'
main.c:20:13: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   20 |     if(p==s+strlen(s)-1)
      |             ^~~~~~
main.c:20:13: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:26:8: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   26 |     if(strlen(t[i])>strlen(t[b]))
      |        ^~~~~~
main.c:26:8: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:29:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   29 |   printf("%s %s\n",t[a],t[b]);
      |   ^~~~~~
main.c:29:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:29:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:29:3: note: include '<stdio.h>' or provide a declaration of 'printf'