复制代码
 1 #include <iostream>
 2 #include <string>
 3 using namespace std;
 4 int j(string str){
 5     int s=0;
 6     if(str=="a" || str=="d" || str=="g" || str=="j" || str=="m" || str=="p" || str=="t" || str=="w"){
 7         s+=1;
 8     }
 9     if(str=="b" || str=="e" || str=="h" || str=="k" || str=="n" || str=="q" || str=="u" || str=="x"){
10         s+=2;
11     }
12     if(str=="c" || str=="f" || str=="i" || str=="l" ||str=="o" || str=="r" || str=="v" || str=="y"){
13         s+=3;
14     }
15     if(str=="s" || str=="z"){
16         s+=4;
17     }
18     return s;
19 }
20 int main(int argc, char** argv) {
21     int cishu=0;
22     int n;
23     string z;
24     cin>>n;
25     int e=n;
26     string str;
27     for(int i=0;i<n;i++){
28         cin>>str;
29         for(int r=0;r<str.size();r++){
30             z=str.substr(r,1);
31             cishu+=j(z);
32         }
33         if(e!=1){
34             cishu++;
35             e--;
36         }
37     }
38     cout<<cishu;
39     return 0;
40 }
复制代码

 

posted on   黛玉醉打将门神  阅读(50)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示