题目描述
简单的字符串拼接
C++ 代码
#include<bits/stdc++.h>
#define endl '\n'
#define debug(a) cout<<#a<<"="<<a<<endl;
#define fast ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define x first
#define y second
#define mm memset
#define int long long
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
int res;
string s;
void solve(){
string a,b;
cin >> a >> b;
int flag = 1;
if(a.size() != b.size()){
cout << -1 << endl;
flag = 0;
}
string ans;
int n = a.size() -1;
for(int i = 0 ; i <= n; i ++){
res = (a[i] - '0') * (b[i] - '0');
s = to_string(res);
ans += s;
}
if(flag){
cout << ans << endl;
}
}
signed main(){
fast
int T;
//T = 1;
cin >> T;
while(T --) solve();
return 0;
}