c++实现
#include <iostream>
#include <string>
using namespace std;
/*
s1 = "abc"
s2 = "cabcd"
dp[i][j]
--------------------------------
---- 0 1 2 3 4
------------------------------
0 -- 0 1 0 0 0
------------------------------
1 -- 0 0 2 0 0
------------------------------
2 -- 1 0 0 3 0
--------------------------------
*/
int main() {
string s1,s2;
while(cin>>s1>>s2) {
if(s1.length()>s2.length()) {
//短的为s1,长的为s2
string t = s1;
s1 = s2;
s2 = t;
}
int dp[s1