题目传送门
做法
这题不难。
就是个位与十位相加。
我就直接读字符串了,这样各个位好加一点。
代码
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int main()
{
int t;
cin >> t;
while (t -- )
{
string s;
cin >> s;
cout << s[0] - '0' + s[1] - '0' << '\n';
}
return 0;
}
