#include <bits/stdc++.h> using namespace std; int n; int shu=0; int main(int argc, char** argv) { cin>>n; string shou; string str; for(int i=0;i<n;i++){ cin>>str; for(int a=0;a<str.size();a++){ shou=str.substr(a,1); if(shou=="a"||shou=="d"||shou=="g"||shou=="j"||shou=="m"||shou=="p"||shou=="t"||shou=="w"){ shu+=1; }else if(shou=="b"||shou=="e"||shou=="h"||shou=="k"||shou=="n"||shou=="q"||shou=="u"||shou=="x"){ shu+=2; }else if(shou=="c"||shou=="f"||shou=="i"||shou=="l"||shou=="o"||shou=="r"||shou=="v"||shou=="z"){ shu+=3; }else if(shou=="s"||shou=="v"||shou=="z"){ shu+=4; } } } cout<<shu+n-1; return 0; }
标签:string,int,str,2023,程序设计,小豫豫 From: https://www.cnblogs.com/hanxuyao/p/17110122.html