Language: C

/*  ex. Welcome to C!                                                           
    nishi.t.aa                                                                
    Nishi Yuuki    */
#include <stdio.h>
#include<stdlib.h>
#include<string.h>
#define SIZE 1000
int len1 = 0; //一つ目のメッセージの長さ
int len2 = 0; //二つ目メッセージの長さ
int length;//メッセージの長さ
char message1[SIZE];
char message2[SIZE];
int **dp;
int resultcount = 0;//重複をのぞいた出力する文字列の数
struct rutype{
    int x;
    int y;
    int point;//左から何番目か,最初が0
    int next[SIZE]; //次に来るもの struct内の番号で管理する -1 がないことを表す
};
rutype *rurecord;//左上を記録して行く。
void search(int now,char s[SIZE]);
int max(int x,int y); //最大値を返す関数
int main(void){
    int i = 0;
    int j=0;
    int k;
    int maxdp = 0; //左上の総数を表す
    int icount;
    int jcount;

    int n = 0;
    int x = 0;
    int y = 0;
    int changecount = 0;
    char s[SIZE];
    char *dpresult;
    fgets(message1, SIZE, stdin); //標準入力で文字列を取得してcharの配列に格納している
    fgets(message2, SIZE, stdin);
    for(i=0;i<SIZE;i++){ //入力文字列の長さを測る
        if(message1[i] == '\0'||message1[i] == '\n'){
            len1 = i;
            break;
        }
    }
    for(i=0;i<SIZE;i++){
        if(message2[i] == '\0'||message2[i] == '\n'){
            len2 = i;
            break;
        }
    }
    dp = (int**)malloc(sizeof(int*)*(len1+1)); //DPをするための配列にメモリを割り当てている
    for(i=0;i<len1+1;i++){
        dp[i] = (int*)malloc(sizeof(int)*(len2+1));
    }
    for(i=0;i<len1+1;i++){
        dp[i][0] = 0;
        dp[i][1] = 0;
    }
    for(j=0;j<len2+1;j++){
        dp[0][j] = 0;
        dp[1][j] = 0;
    }
    for(i=1;i<len1+1;i++){ // DPをする iが行 jが列
        for(j=1;j<len2+1;j++){
            if(message1[i-1] == message2[j-1]){//最後尾の文字が同じだった場合なので、左上の数字に１を足して記録する
                k=1;
                printf("ss");
                /*while(1){
                    if(j-1-k<0){
                        break;
                    }
                    if(message2[j-1]==message2[j-1-k]){
                        dp[i][j] = max(dp[i-1][j],dp[i][j-1]);
                        continue;
                    }
                    if(dp[i][j-k]!=dp[i][j-k-1]){
                        break;
                    }
                    k+=1;
                }*/
                //rurecord[maxdp] = {i,j,dp[i][j],temp};
                dp[i][j] = dp[i-1][j-1] + 1;
                changecount +=1;
            }else{
                dp[i][j] = max(dp[i-1][j],dp[i][j-1]); //同じではなかった
            }
        }
    }
            printf("    ");
        for(j=0;j<len2+1;j++){
            printf("%c ",message2[j]);
        }
    for(i=0;i<len1+1;i++){
        printf("%c ",message1[i-1]);
        for(j=0;j<len2+1;j++){
            printf("%d ",dp[i][j]);
        }
        printf("\n");
    }
    rurecord = (rutype*)malloc(sizeof(rutype)*(changecount));
    for(i=1;i<len1+1;i++){//「左上」を検索していく
        for(j=1;j<len2+1;j++){
            if(dp[i][j]-1==dp[i][j-1]&&dp[i][j]-1==dp[i-1][j]){
                rurecord[maxdp].x = j;
                rurecord[maxdp].y = i;
                //printf("kl %d %d \n",rurecord[maxdp].x,rurecord[maxdp].y);
                rurecord[maxdp].point = dp[i][j];
                for(k=0;k<SIZE;k++){
                    rurecord[maxdp].next[k] = -1;
                }
                maxdp +=1;
            }
        }
    }
    length = dp[len1][len2];
    for(i=0;i<maxdp-1;i++){
        for(j=1+i;j<maxdp;j++){
            if(rurecord[i].x<rurecord[j].x&&rurecord[i].y<rurecord[j].y&&rurecord[i].point+1==rurecord[j].point){//もっと右下かを判定
                //printf("h %d %d \n",rurecord[j].x,rurecord[j].y);
                k=0;
                while(rurecord[i].next[k]!=-1){ //新しく記録
                    k += 1;
                }
                //printf("%d %d\n",k,j);
                rurecord[i].next[k] = j;
            }
        }
    }
    
    //printf("%d %d\n",maxdp,rurecord[0].next[0]);
    for(i=0;i<SIZE;i++){
        s[i] = ' ';
    }
    search(0,s);
    return 0;
}
int max(int x,int y){
    if(x>y){
        return x;
    }else{
        return y;
    }
}
void search(int now,char s[SIZE]){//numが左から何番目か、nowが今どこにいるか
    int i = 0;
    //printf("now point %d %d\n",now,rurecord[now].point);
    //printf("s0 %c\n",s[0]);
    s[rurecord[now].point-1] = message1[rurecord[now].y-1];//記録して次へ
    if(rurecord[now].point == length){
        for(i=0;s[i] !=' ';i++){
            printf("%c",s[i]);
        }
        printf("\n");
        return;
    }
    for(i=0;rurecord[now].next[i]!=-1;i++){
        //printf("next x y %d %d %d\n",rurecord[now].next[i],rurecord[rurecord[now].next[i]].x,rurecord[rurecord[now].next[i]].y);
        search(rurecord[now].next[i],s);
    }
    return;
    /*if(numleft > maxdp){
        for(i=0;i<resultcount;i++){
            flag = false
            for(j=0;j<maxdp;j++){
                if(result[i][j] != charresult[j]){
                    flag = true;
                    break; //違う文字列だった
                }
            }
            if(flag == false){//同じ文字列が記録済みだった
                return;
            }
        }
        for(i=0;i<maxdp;i++){
            result[resultcount][i] = charresult[i];
            cout << charresult[i];
        }
        cout << endl;
        resultcount++;
        return;
    }
    if(x==0||y==0){
        return;
    }
    if(x == 1&&y==1){//一番左上に到達したので、先頭の文字が同じかどうかをチェックして終わりにする
        if(dp[1][1]==1){
            result[maxdp]=message1[y-1];
        }
        return;
    }
    bool flag = false;
    if(dp[y][x]==dp[y-1][x]&&y>1){//上に移動する
        search(y-1,x,charresult[maxdp],numleft);
        flag = true;
    }
    if(dp[y][x]==dp[y][x-1]&&x>1){//左に移動する
        search(y,x-1,charresult[maxdp],numleft);
        flag = true;
    }
    if(flag == false){
        charresult[maxdp-numleft]=message1[y-1];
        if(message1[y-1]!=message2[x-1]){
            printf("ERROR");
            return;
        }
        
        search(x-1,y-1,charresult,numleft-1);
    }
    return; */

}

Compiler output:
main.c:21:1: error: unknown type name 'rutype'; use 'struct' keyword to refer to the type
   21 | rutype *rurecord;//左上を記録して行く。
      | ^~~~~~
      | struct 
main.c: In function 'main':
main.c:101:17: error: 'rutype' undeclared (first use in this function)
  101 |     rurecord = (rutype*)malloc(sizeof(rutype)*(changecount));
      |                 ^~~~~~
main.c:101:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:101:24: error: expected expression before ')' token
  101 |     rurecord = (rutype*)malloc(sizeof(rutype)*(changecount));
      |                        ^
main.c:105:32: error: request for member 'x' in something not a structure or union
  105 |                 rurecord[maxdp].x = j;
      |                                ^
main.c:106:32: error: request for member 'y' in something not a structure or union
  106 |                 rurecord[maxdp].y = i;
      |                                ^
main.c:108:32: error: request for member 'point' in something not a structure or union
  108 |                 rurecord[maxdp].point = dp[i][j];
      |                                ^
main.c:110:36: error: request for member 'next' in something not a structure or union
  110 |                     rurecord[maxdp].next[k] = -1;
      |                                    ^
main.c:119:27: error: request for member 'x' in something not a structure or union
  119 |             if(rurecord[i].x<rurecord[j].x&&rurecord[i].y<rurecord[j].y&&rurecord[i].point+1==rurecord[j].point){//もっと右下かを判定
      |                           ^
main.c:119:41: error: request for member 'x' in something not a structure or union
  119 |             if(rurecord[i].x<rurecord[j].x&&rurecord[i].y<rurecord[j].y&&rurecord[i].point+1==rurecord[j].point){//もっと右下かを判定
      |                                         ^
main.c:119:56: error: request for member 'y' in something not a structure or union
  119 |             if(rurecord[i].x<rurecord[j].x&&rurecord[i].y<rurecord[j].y&&rurecord[i].point+1==rurecord[j].point){//もっと右下かを判定
      |                                                        ^
main.c:119:70: error: request for member 'y' in something not a structure or union
  119 |             if(rurecord[i].x<rurecord[j].x&&rurecord[i].y<rurecord[j].y&&rurecord[i].point+1==rurecord[j].point){//もっと右下かを判定
      |                                                                      ^
main.c:119:85: error: request for member 'point' in something not a structure or union
  119 |             if(rurecord[i].x<rurecord[j].x&&rurecord[i].y<rurecord[j].y&&rurecord[i].point+1==rurecord[j].point){//もっと右下かを判定
      |                                                                                     ^
main.c:119:106: error: request for member 'point' in something not a structure or union
  119 |             if(rurecord[i].x<rurecord[j].x&&rurecord[i].y<rurecord[j].y&&rurecord[i].point+1==rurecord[j].point){//もっと右下かを判定
      |                                                                                                          ^
main.c:122:34: error: request for member 'next' in something not a structure or union
  122 |                 while(rurecord[i].next[k]!=-1){ //新しく記録
      |                                  ^
main.c:126:28: error: request for member 'next' in something not a structure or union
  126 |                 rurecord[i].next[k] = j;
      |                            ^
main.c: In function 'search':
main.c:149:20: error: request for member 'point' in something not a structure or union
  149 |     s[rurecord[now].point-1] = message1[rurecord[now].y-1];//記録して次へ
      |                    ^
main.c:149:54: error: request for member 'y' in something not a structure or union
  149 |     s[rurecord[now].point-1] = message1[rurecord[now].y-1];//記録して次へ
      |                                                      ^
main.c:150:21: error: request for member 'point' in something not a structure or union
  150 |     if(rurecord[now].point == length){
      |                     ^
main.c:157:26: error: request for member 'next' in something not a structure or union
  157 |     for(i=0;rurecord[now].next[i]!=-1;i++){
      |                          ^
main.c:159:29: error: request for member 'next' in something not a structure or union
  159 |         search(rurecord[now].next[i],s);
      |                             ^