Language: C

#include<stdio.h>#include <string.h>
short dp[4001][4001]={},ans=0;char str1[2][4005];int main(){while(scanf("%s",str1[0])!=-1){scanf("%s",str1[1]);int a=strlen(str1[0]),b=strlen(str1[1]); for(int i=0;i<a;i++){for(int j=0;j<b;j++){if(str1[0][i]==str1[1][j]){if(!i || !j){dp[i][j]=1;if(!ans){ans++;}}else{dp[i][j]=1+dp[i-1][j-1];ans=ans<dp[i][j]?dp[i][j]:ans;}}}}printf("%d\n",ans); ans=0;memset(dp,0,sizeof(dp));}return 0;}

Compiler output:
main.c:1:18: warning: extra tokens at end of #include directive
    1 | #include<stdio.h>#include <string.h>
      |                  ^
main.c: In function 'main':
main.c:2:118: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
    2 | short dp[4001][4001]={},ans=0;char str1[2][4005];int main(){while(scanf("%s",str1[0])!=-1){scanf("%s",str1[1]);int a=strlen(str1[0]),b=strlen(str1[1]); for(int i=0;i<a;i++){for(int j=0;j<b;j++){if(str1[0][i]==str1[1][j]){if(!i || !j){dp[i][j]=1;if(!ans){ans++;}}else{dp[i][j]=1+dp[i-1][j-1];ans=ans<dp[i][j]?dp[i][j]:ans;}}}}printf("%d\n",ans); ans=0;memset(dp,0,sizeof(dp));}return 0;}
      |                                                                                                                      ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
    1 | #include<stdio.h>#include <string.h>
  +++ |+#include <string.h>
    2 | short dp[4001][4001]={},ans=0;char str1[2][4005];int main(){while(scanf("%s",str1[0])!=-1){scanf("%s",str1[1]);int a=strlen(str1[0]),b=strlen(str1[1]); for(int i=0;i<a;i++){for(int j=0;j<b;j++){if(str1[0][i]==str1[1][j]){if(!i || !j){dp[i][j]=1;if(!ans){ans++;}}else{dp[i][j]=1+dp[i-1][j-1];ans=ans<dp[i][j]?dp[i][j]:ans;}}}}printf("%d\n",ans); ans=0;memset(dp,0,sizeof(dp));}return 0;}
main.c:2:118: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
    2 | short dp[4001][4001]={},ans=0;char str1[2][4005];int main(){while(scanf("%s",str1[0])!=-1){scanf("%s",str1[1]);int a=strlen(str1[0]),b=strlen(str1[1]); for(int i=0;i<a;i++){for(int j=0;j<b;j++){if(str1[0][i]==str1[1][j]){if(!i || !j){dp[i][j]=1;if(!ans){ans++;}}else{dp[i][j]=1+dp[i-1][j-1];ans=ans<dp[i][j]?dp[i][j]:ans;}}}}printf("%d\n",ans); ans=0;memset(dp,0,sizeof(dp));}return 0;}
      |                                                                                                                      ^~~~~~
main.c:2:118: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:2:352: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
    2 | short dp[4001][4001]={},ans=0;char str1[2][4005];int main(){while(scanf("%s",str1[0])!=-1){scanf("%s",str1[1]);int a=strlen(str1[0]),b=strlen(str1[1]); for(int i=0;i<a;i++){for(int j=0;j<b;j++){if(str1[0][i]==str1[1][j]){if(!i || !j){dp[i][j]=1;if(!ans){ans++;}}else{dp[i][j]=1+dp[i-1][j-1];ans=ans<dp[i][j]?dp[i][j]:ans;}}}}printf("%d\n",ans); ans=0;memset(dp,0,sizeof(dp));}return 0;}
      |                                                                                                                                                                                                                                                                                                                                                                ^~~~~~
main.c:2:352: note: include '<string.h>' or provide a declaration of 'memset'
main.c:2:352: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch]
main.c:2:352: note: include '<string.h>' or provide a declaration of 'memset'