解题思路:
注意事项:
参考代码:
#include<iostream> #include<bits/stdc++.h> using namespace std; int main() { int score=0; string str1="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; int arr[27]={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}; string str; cin>>str; for(int i=0;i<str.length();i++){ for(int j=0;j<str1.length();j++){ if(toupper(str[i])==str1[j]) score+=arr[j]; } } cout<<score<<endl; return 0; }
0.0分
0 人评分
【矩阵】 (C++代码)浏览:947 |
【计算两点间的距离】 (C语言代码)浏览:1482 |
C语言程序设计教程(第三版)课后习题5.6 (C语言代码)浏览:901 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:486 |
2003年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:670 |
理财计划 (C语言代码)浏览:467 |
链表数据求和操作 (C语言代码)浏览:942 |
C语言程序设计教程(第三版)课后习题12.1 (C语言代码)浏览:645 |
C二级辅导-等差数列 (C语言代码)浏览:810 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:772 |