解题思路:
注意事项:
参考代码:
#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++代码)浏览:865 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:885 |
C语言程序设计教程(第三版)课后习题6.4 (C语言代码)浏览:597 |
A+B for Input-Output Practice (III) (C语言代码)浏览:569 |
C语言程序设计教程(第三版)课后习题10.7 (C语言代码)浏览:538 |
WU-图形输出 (C++代码)浏览:800 |
IP判断 (C语言代码)浏览:761 |
C语言程序设计教程(第三版)课后习题10.4 (C语言代码)浏览:879 |
a+b浏览:432 |
GC的苦恼 (C语言代码)浏览:618 |