ZOJ 2812 Quicksum
2016-01-24 14:38
441 查看
#include <bits/stdc++.h> #define _ ios_base::sync_with_stdio(0);cin.tie(0); #include <iostream> #include <sstream> #include <iomanip> #include <vector> #include <deque> #include <list> #include <set> #include <map> #include <stack> #include <queue> #include <bitset> #include <string> #include <numeric> #include <algorithm> #include <functional> #include <iterator> #include <cstdio> #include <cstring> #include <cmath> #include <cstdlib> #include <cctype> #include <complex> #include <ctime> #define INF 0x3f3f3f3f #define eps 1e-6 typedef long long LL; const double pi = acos(-1.0); const double delta = 1e-9; const long long mod = 1e9 + 7; using namespace std; char s[100005]; int main() { //freopen("int.txt","r",stdin); //freopen("out.txt","w",stdout); while(gets(s)) { if(s[0] == '#') return 0; int ans = 0; int len = strlen(s); for(int i = 0;i < len;i++) { if(s[i] == ' '); else ans += (s[i] - 'A' + 1) * (i + 1); } printf("%d\n",ans); } return 0; }
相关文章推荐
- UIAlertController详解
- android.util.AndroidRuntimeException: requestFeature() must be called before adding content
- UISearchBar控件
- 虚拟机下安装UEFI+GPT+win7x64
- ubuntu下cmake3.4的安装(有GUI界面)
- QuickLook(简介)
- duilib 界面库 实现timer定时器
- 修改UITextField的占位文字颜色的三种层次
- 298. Binary Tree Longest Consecutive Sequence
- UE32 删除空行正则表达式 .
- APUE_文件管理
- UIImageView的两种创建方式的比较
- DP------Unique Paths II
- How to building OpenSSL 0.9.8c
- QtCharts笔记之QValueAxis
- bluestacks启动问题
- Which statement is true about loading data using the conventional path of SQL*Loader? A.Redo is not
- User SCOTT executes the following command on the EMP table but has not issued COMMIT, ROLLBACK, or a
- UILabel---.tff格式字体
- - (UIImage*)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapH