The Love-Letter Mystery
#include #include #include #include #include #include using namespace std;int main() { int T; cin>>T; string str; getline(cin,str); while(T--) { string str1; int count; getline(cin,str1); count = str1.length() ; int sum = 0,n = 0; int j = count/2; for(int i = 0;i < j ;i++) { if(static_cast (str1[count - 1 - i]) >= static_cast (str1[0 + i])) { n = static_cast (str1[count - 1 - i] - str1[0 + i]); sum += n; } else { n = static_cast (str1[0 + i]) - static_cast (str1[count - 1 - i]); sum += n; } } cout< <