Language: C++

#include <bits/stdc++.h>
using namespace std;

const int MAXN = 4000;

int dp[MAXN][MAXN];

char s, t;

int main(){
	scanf(" %s", s);
	scanf(" %s", t);
	int stam = strlen(s);
	int ttam = strlen(t);
	for(int i = 0; i < stam; i++){
		for(int j = 0; j < ttam; j++){
			if (i == 0 && j == 0){
				if(s[i] == t[j]) dp[i][j] = 1;
				else dp[i][j] = 0;
			}
			else if(i == 0){
				if(dp[i][j - 1] == 0 && s[i] == t[j]) dp[i][j]= 1;
				else dp[i][j] = dp[i][j - 1];
			}
			else if(j == 0){
				if(dp[i - 1][j] == 0 && s[i] == t[j]) dp[i][j]= 1;
				else dp[i][j] = dp[i - 1][j];
			}
			else{
				if(s[i] == t[j]) dp[i][j] = dp[i - 1][j - 1] + 1;
				else dp[i][j] = max(dp[i][j - 1], dp[i - 1][j]);
			}
		}
	}
	printf("%d\n", dp[stam - 1][ttam - 1]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:27: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   13 |         int stam = strlen(s);
      |                           ^
      |                           |
      |                           char
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc:14:27: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   14 |         int ttam = strlen(t);
      |                           ^
      |                           |
      |                           char
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc:18:37: error: invalid types 'char[int]' for array subscript
   18 |                                 if(s[i] == t[j]) dp[i][j] = 1;
      |                                     ^
a.cc:18:45: error: invalid types 'char[int]' for array subscript
   18 |                                 if(s[i] == t[j]) dp[i][j] = 1;
      |                                             ^
a.cc:22:58: error: invalid types 'char[int]' for array subscript
   22 |                                 if(dp[i][j - 1] == 0 && s[i] == t[j]) dp[i][j]= 1;
      |                                                          ^
a.cc:22:66: error: invalid types 'char[int]' for array subscript
   22 |                                 if(dp[i][j - 1] == 0 && s[i] == t[j]) dp[i][j]= 1;
      |                                                                  ^
a.cc:26:58: error: invalid types 'char[int]' for array subscript
   26 |                                 if(dp[i - 1][j] == 0 && s[i] == t[j]) dp[i][j]= 1;
      |                                                          ^
a.cc:26:66: error: invalid types 'char[int]' for array subscript
   26 |                                 if(dp[i - 1][j] == 0 && s[i] == t[j]) dp[i][j]= 1;
      |                                                                  ^
a.cc:30:37: error: invalid types 'char[int]' for array subscript
   30 |                                 if(s[i] == t[j]) dp[i][j] = dp[i - 1][j - 1] + 1;
      |                                     ^
a.cc:30:45: error: invalid types 'char[int]' for array subscript
   30 |                                 if(s[i] == t[j]) dp[i][j] = dp[i - 1][j - 1] + 1;
      |                                             ^