题解:
1、字母是大写的A~S,超过S的就回到A并且进位(就是模拟19进制的三位数计算)
#include <iostream>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
string str;
cin >> str;
int sum = 0;
while(str[0]!='S' || str[1]!='S' || str[2]!='R'){
str[2]++;
sum++;
if(str[2]=='T'){
str[2]='A';
str[1]++;
if(str[1]=='T'){
str[1]='A';
str[0]++;
}
}
}
cout << sum << endl;
}
return 0;
}