输入格式
第一行,一个整数 t (1≤t≤100 ) 表示输入的算式个数。
下面 t 行,每行一个 a+b 的算式,注意加号旁边没有空格。( 0≤a,b≤9,a 和 b 都是整数 )
输出格式
对于每个算式,输出这个算式的结果。
冷知识:字符减去48或者 '0'就是他真实的值
话说这个冷知识谁都知道吧
另外要注意字符串下标从0开始
老规矩,上代码,走你q(≧▽≦q)
//今天你数组调大小了吗
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <queue>
#include <cstring>
#include <stack>
#include <vector>
#include <set>
#include <cstdio>
#include <cmath>
#include <map>
using namespace std;
int main(){
int t;
cin>>t;
for(int i=1;i<=t;i++){
string s;
cin>>s;
cout<<int(s[0]-48+s[2]-48)<<endl;
}
return 0;
}