【April Fools Day Contest 2016C】【流程图翻译】Without Text

来源:互联网 发布:关键词排名优化工具 编辑:程序博客网 时间:2024/06/07 08:22

C. Without Text
time limit per test
2 seconds
memory limit per test
64 megabytes
input
standard input
output
standard output

You can preview the image in better quality by the link: http://assets.codeforces.com/files/656/without-text.png

Input

The only line of the input is a string (between 1 and 50 characters long, inclusive). Each character will be an alphanumeric character or a full stop ".".

Output

Output the required answer.

Examples
input
Codeforces
output
-87
input
APRIL.1st
output
17

#include<stdio.h>#include<iostream>#include<string.h>#include<string>#include<ctype.h>#include<math.h>#include<set>#include<map>#include<vector>#include<queue>#include<bitset>#include<algorithm>#include<time.h>using namespace std;void fre() { freopen("c://test//input.in", "r", stdin); freopen("c://test//output.out", "w", stdout); }#define MS(x,y) memset(x,y,sizeof(x))#define MC(x,y) memcpy(x,y,sizeof(x))#define MP(x,y) make_pair(x,y)#define ls o<<1#define rs o<<1|1typedef long long LL;typedef unsigned long long UL;typedef unsigned int UI;template <class T1, class T2>inline void gmax(T1 &a, T2 b) { if (b>a)a = b; }template <class T1, class T2>inline void gmin(T1 &a, T2 b) { if (b<a)a = b; }const int N = 0, M = 0, Z = 1e9 + 7, ms63 = 0x3f3f3f3f;int casenum, casei;char s[60];int main(){while(~scanf("%s",s)){int ans = 0;for (int i = 0; s[i]; ++i){if (s[i] >= 'a'&&s[i] <= 'z')ans -= s[i] - 'a'+1;if (s[i] >= 'A'&&s[i] <= 'Z')ans += s[i] - 'A'+1;}printf("%d\n", ans);}return 0;}/*【题意】http://assets.codeforces.com/files/656/without-text.png【类型】流程图翻译*/


0 0
原创粉丝点击