C. Without Text

题目连接:

http://www.codeforces.com/contest/656/problem/C

Description

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.

Sample Input

Codeforces

Sample Output

-87

Hint

题意

给你一个信号系统,然后问你输出是啥

题解:

还好我专业课是信号与系统,没事儿干就看这种图片……

模拟模拟就好了

代码

#include<bits/stdc++.h>
using namespace std; string s;
int id(char c)
{
if(c>='A'&&c<='Z')return c-'A'+1;
if(c>='a'&&c<='z')return c-'a'+1;
}
int main()
{
long long res = 0;
cin>>s;
for(int i=0;i<s.size();i++)
{
char a1 = '@';
char a2 = '[';
char a3 = '`';
char a4 = '{';
int flag1 = (a1<s[i])&(a2>s[i]);
int flag2 = (a3<s[i])&(a4>s[i]);
res = res + (flag1*id(s[i]))-(flag2*id(s[i]));
}
cout<<res<<endl;
}

April Fools Day Contest 2016 C. Without Text 信号与系统的更多相关文章

  1. April Fools Day Contest 2016 D. Rosetta Problem

    D. Rosetta Problem 题目连接: http://www.codeforces.com/contest/656/problem/D Description ++++++++[>+& ...

  2. April Fools Day Contest 2016 G. You're a Professional

    G. You're a Professional 题目连接: http://www.codeforces.com/contest/656/problem/G Description A simple ...

  3. April Fools Day Contest 2016 F. Ace It!

    F. Ace It! 题目连接: http://www.codeforces.com/contest/656/problem/F Description Input The only line of ...

  4. April Fools Day Contest 2016 E. Out of Controls

    E. Out of Controls 题目连接: http://www.codeforces.com/contest/656/problem/E Description You are given a ...

  5. April Fools Day Contest 2016 B. Scrambled

    B. Scrambled 题目连接: http://www.codeforces.com/contest/656/problem/B Description Btoh yuo adn yuor roo ...

  6. April Fools Day Contest 2016 A. Da Vinci Powers

    A. Da Vinci Powers 题目连接: http://www.codeforces.com/contest/656/problem/A Description The input conta ...

  7. CF #April Fools Day Contest 2016 E Out of Controls

    题目连接:http://codeforces.com/problemset/problem/656/E 愚人节专场的E,整个其实就是个Floyd算法,但是要求代码中不能包含 definedoforfo ...

  8. April Fools Day Contest 2014

    April Fools Day Contest 2014 A.C.H三道题目 ============================================================= ...

  9. 坑爹CF April Fools Day Contest题解

    H - A + B Strikes Back A + B is often used as an example of the easiest problem possible to show som ...

随机推荐

  1. Django【设计】同功能不同实现模式的兼容性

    需求: 当我们采集硬件信息时,客户端可以有多种方式,具体方式取决于客户机,CMDB项目中,我们有三种方式可选,AGENT/SSH/SALT,根据客户机具体情况和“SALT>>SSH> ...

  2. offset宏的讲解【转】

    转自:http://blog.csdn.net/tigerjibo/article/details/8299584 1.offset宏讲解 #define offsetof(TYPE, MEMBER) ...

  3. Git学习笔记3 git revert

    我们难免会因为种种原因执行一些错误的commit / push,git提供了revert命令帮助程序员修复这样的错误. 举个例子,下图是git commit 的历史记录 git revert 命令会通 ...

  4. Mac OS X 编译android内核 error: elf.h: No such file or directory 的解决方法

    1. 从网上下个elf.h放到scripts/mod/文件夹(http://www.rockbox.org/tracker/9006?getfile=16683) 2. 修改两个文件mk_elfcon ...

  5. Hadoop(一):概述

    一.Hadoop是什么? Hadoop是一个由Apache基金会所开发的分布式系统基础架构.Hadoop框架最核心的设计包含两个方面,一是分布式文件系统(Hadoop Distributed File ...

  6. Linux软件安装install命令

    install  1.作用 install命令的作用是安装或升级软件或备份数据,它的使用权限是所有用户. 2.格式 (1)install [选项]... 来源 目的地 (2)install [选项]. ...

  7. plsql实例精讲部分笔记

    转换sql: create or replace view v_sale(year,month1,month2,month3,month4,month5,month6,month7,month8,mo ...

  8. Porting of cURL to Android OS using NDK (from The Software Rogue)

    Porting of cURL to Android OS using NDK   In continuing my journey into Android territory, I decided ...

  9. 洛谷P1876开灯 题解

    题目传送门 这道题目是道数学题(下面也写了),所以仔细研究发现:N轮之后,只有是小于N的完全平方数的灯能亮着.所以接下来就好办了: #include<bits/stdc++.h> usin ...

  10. qt调用仪器驱动库dll实现程控

    在<使用qt+visa实现程控>中实现了qt调用visa库的简单Demo本文将尝试使用qt调用仪器驱动库来实现对仪器仪表的程控 开发环境 系统: windows 10 环境: qt 5.8 ...