Sicily 1388. Quicksum
又一道字符串的水题....
#include <iostream>
#include <cstring> using namespace std; int main()
{
char ch[260];
while(cin.getline(ch,260))
{
if(ch[0] == '#') break;
int ans = 0;
int n = strlen(ch);
for(int i=0;i < n;++i)
{
if(ch[i] >= 'A' && ch[i] <= 'Z')
ans += (ch[i] - 'A' + 1)*(i + 1);
}
cout<<ans<<endl;
}
return 0;
}
Sicily 1388. Quicksum的更多相关文章
- AC日记——砍树 codevs 1388
1388 砍树 时间限制: 1 s 空间限制: 256000 KB 题目等级 : 黄金 Gold 题解 查看运行结果 题目描述 Description 伐木工人米尔科需要砍倒M米长的木 ...
- sicily 中缀表达式转后缀表达式
题目描述 将中缀表达式(infix expression)转换为后缀表达式(postfix expression).假设中缀表达式中的操作数均以单个英文字母表示,且其中只包含左括号'(',右括号‘)’ ...
- sicily 1934. 移动小球
Description 你有一些小球,从左到右依次编号为1,2,3,...,n. 你可以执行两种指令(1或者2).其中, 1 X Y表示把小球X移动到小球Y的左边, 2 X Y表示把小球X移动到小球Y ...
- [字符哈希] POJ 3094 Quicksum
Quicksum Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 16488 Accepted: 11453 Descri ...
- hihocoder #1388 : Periodic Signal NTT&FFT
传送门:hihocoder #1388 : Periodic Signal 先来几个大牛传送门: (模板) NTT long long 版 解法一:因为我们知道FFT会精度不够,所以坚持用NTT,但 ...
- Quicksum -SilverN
quicksum Given a string of digits, find the minimum number of additions required for the string to e ...
- hihocoder 1388 &&2016 ACM/ICPC Asia Regional Beijing Online Periodic Signal
#1388 : Periodic Signal 时间限制:5000ms 单点时限:5000ms 内存限制:256MB 描述 Profess X is an expert in signal proce ...
- 大数求模 sicily 1020
Search
- ACM——Quicksum
Quicksum 时间限制(普通/Java):1000MS/3000MS 运行内存限制:65536KByte总提交:615 测试通过:256 描述 A chec ...
随机推荐
- RPO漏洞学习
不能直接复制markdown上来真的是痛苦,图片还要手动上传. 算了,不贴了. 这是PDF版https://files.cnblogs.com/files/r00tuser/RPO%E6%BC%8F% ...
- Android-序列化-Serializable/Parcelable
Android-序列化-Serializable/Parcelable 学习自 <Android开发艺术探索> 序列化漫谈 IPC的首要目的是传输数据,当然不能仅仅是传输一些基础数据了,毕 ...
- DPDK+OpenvSwitch-centos7.4安装
系统版本 [root@controller ~]# cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) DPDK版本: dpdk- ...
- 清北学堂省选刷题冲刺班 Test Day3
目录 2018.3.27 Test T1 T2 T3 考试代码 T2 T3 2018.3.27 Test 时间:8:00~11:30 期望得分:100+60+25=185 实际得分:100+40+25 ...
- 简单单层bp神经网络
单层bp神经网络是解决线性可回归问题的. 该代码是论文:https://medium.com/technology-invention-and-more/how-to-build-a-simple-n ...
- 【精选】Jupyter Notebooks里的TensorFlow图可视化
[精选]Jupyter Notebooks里的TensorFlow图可视化 https://mp.weixin.qq.com/s?src=11×tamp=1503060682&a ...
- How to convert a byte to its binary string representation
How to convert a byte to its binary string representation For example, the bits in a byte B are 1000 ...
- CRC校验的实现
本例提供的是通过查表发来实现CRC校验. CRC余式表如下: unsigned int crctab[256] ={/*CRC余式表 */ 0x0000, 0x1021, 0x2042, 0x3063 ...
- Promise,Generator(生成器),async(异步)函数
Promise 是什么 Promise是异步编程的一种解决方案.Promise对象表示了异步操作的最终状态(完成或失败)和返回的结果. 其实我们在jQuery的ajax中已经见识了部分Promise的 ...
- c#开发activex注册问题
最近使用c#开发activex,遇到一个问题,生成的dll文件在本地可以嵌入到web里面,但是到其他机器上就会出现activex无法加载的情况,页面里面出现一个红色的X.mfc开发的activex是使 ...