题目一
# include<iostream>
using namespace std;
int main()
{
int n;
cin >> n;
while(n--)
{
int a, b, x, y;
cin >> a >> b;
x = (a + b) / 2;
y = (a - b) / 2;
cout << x << " " << y << endl;
}
return 0;
}
题目二
# include<iostream>
# include<string>
# include<algorithm>
using namespace std;
bool is_substring(string s1, string s2)
{
string::iterator it = s2.begin();
int len = s1.length();
for(int i = 0; i < len; i++)
{
it = find(it, s2.end(), s1[i]);
if(it == s2.end())
return false;
}
return true;
}
int main()
{
int n;
cin >> n;
while(n--)
{
string s1, s2;
cin >> s1 >> s2;
if(is_substring(s1, s2))
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
}