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 the input is a string of 7 characters. The first character is letter A, followed by 6 digits. The input is guaranteed to be valid (for certain definition of "valid").
Output
Output a single integer.
Sample Input
A221033
Sample Output
21
Hint
题意
给你一个字符串,然后输出答案
题解:
仔细观察,大胆猜测,就是数位数字之和,A是1,1是10
然后不要oeis hhh
代码
#include<bits/stdc++.h>
using namespace std;
string s;
int main()
{
cin>>s;
int res = 0;
for(int i=0;i<s.size();i++)
{
if(s[i]>='2'&&s[i]<='9')
res+=(int)(s[i]-'0');
else if(s[i]=='1')res+=10;
}
cout<<res+1<<endl;
}
April Fools Day Contest 2016 F. Ace It!的更多相关文章
- 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 ...
- April Fools Day Contest 2016 D. Rosetta Problem
D. Rosetta Problem 题目连接: http://www.codeforces.com/contest/656/problem/D Description ++++++++[>+& ...
- 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 ...
- April Fools Day Contest 2016 C. Without Text 信号与系统
C. Without Text 题目连接: http://www.codeforces.com/contest/656/problem/C Description You can preview th ...
- April Fools Day Contest 2016 B. Scrambled
B. Scrambled 题目连接: http://www.codeforces.com/contest/656/problem/B Description Btoh yuo adn yuor roo ...
- 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 ...
- CF #April Fools Day Contest 2016 E Out of Controls
题目连接:http://codeforces.com/problemset/problem/656/E 愚人节专场的E,整个其实就是个Floyd算法,但是要求代码中不能包含 definedoforfo ...
- April Fools Day Contest 2014
April Fools Day Contest 2014 A.C.H三道题目 ============================================================= ...
- 坑爹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 ...
随机推荐
- 64_r2
ruby-gnomecanvas2-0.90.4-7.fc26.3.x86_64.rpm 13-Feb-2017 08:00 75794 ruby-gnomecanvas2-devel-0.90.4- ...
- 64_n2
nodejs-from-0.1.3-4.fc26.noarch.rpm 11-Feb-2017 15:01 9982 nodejs-from2-2.1.0-6.fc26.noarch.rpm 11-F ...
- tp 框架 利用反射实现对象调用方法
<?php class Person{ public $name="xiaoming"; function say(){ echo "i am ".$th ...
- HTTPS握手过程
HTTPS在HTTP的基础上加入了SSL协议,SSL依靠证书来验证服务器的身份,并为浏览器和服务器之间的通信加密.具体是如何进行加密,解密,验证的,且看下图,下面的称为一次握手. 1. 客户端发起HT ...
- linux 下配置文件目录/etc/sysconfig
/etc/sysconfig/目录详解 2010-06-19 11:12 6693人阅读 评论(1) 收藏 举报 桌面环境debugging防火墙serviceunix语言 /etc/sysconfi ...
- 根据名字杀死进程Killall
Killall命令可以用来给一个特定的进程发送一个信号.这个信号默认情况下是SIGTERM,但也可以由killall命令使用参数来指定其它信号.现在让我们通过一些实际的例子来看看这个命令的实际用法. ...
- 半小时分组统计个数sql
group by 最后一个时间是多少按多少分组 select count(1), trunc(a.refund_insert_time, 'hh24') + case when to_char(ref ...
- Selenium_Page Object设计模式
Page Object 介绍 Page Object设计模式的优点如下: 减少代码的重复 提高测试用例的可读性 提高测试用例的可维护性,特别是针对UI频繁变化的项目 当Web页面编写测试时,需要操作该 ...
- Synergy,一个软件团队质量改进之路之一 --- 规划
关于质量改进 ISO9001:2000的核心思想是持续改进 ISO关于质量管理有8项原则: 原则一: 以顾客为关注焦点 原则二: 领导作用 原则三: 全员参与 原则四: 过程方法 原则五:管理的系统方 ...
- 简易web server之python实现
网络编程一项基本功是socket编程,包括TCP socket,UDP socket的客户端.服务器端编程. 应用层的各路协议如http,smtp,telnet,ftp等都依赖于传输层的TCP或者UD ...