// 思路是网上以一位大神的,特简单直接采用字符串,判断长度,还有最后一个元素是否T,便可通过ASCll输出数字;
#include <iostream> #include <string> using namespace std; string s; int main(){ while (cin >> s){ if (s.size() == 3 && s[2] == 'T') cout << s[0] - 'A' + 1; } cout << endl; return 0; }

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。