https://www.acmicpc.net/problem/10953
A와 B가 콤마로 구분된 점을 활용하면 됩니다.
#include <iostream>
using namespace std;
int T;
string str;
int main()
{
ios::sync_with_stdio(0), cin.tie(0);
cin >> T;
while (T--)
{
cin >> str;
cout << (str[0] - '0' + str[2] - '0') << "\n";
}
return 0;
}
A와 B가 0보다 크고 10보다 작기에 1자리씩만 차지한다는 것을 알 수 있습니다. 0번째와 2번째를 파싱하면 됩니다.