POJ 3094 Quicksum 难度:0
http://poj.org/problem?id=3094
#include<iostream>
#include <string>
using namespace std;
int main()
{
string str;
getline(cin,str);
while(str != "#")
{
int ans = ;
for(int i = ;i < str.length(); i++)
{
if(str[i] == '#') return ;
if(str[i] >= 'A' && str[i] <= 'Z')
{
ans += (str[i] - 'A' + ) * (i + );
}
}
cout<<ans<<endl;
getline(cin,str);
}
return ;
}
POJ 3094 Quicksum 难度:0的更多相关文章
- [字符哈希] POJ 3094 Quicksum
Quicksum Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 16488 Accepted: 11453 Descri ...
- POJ 3299 Humidex 难度:0
题目链接:http://poj.org/problem?id=3299 #include <iostream> #include <iomanip> using namespa ...
- POJ 3094 Quicksum(简单的问题)
[简要题意]:题意是非常easy. 看样能理解 [分析]:略. 读取字符串. // 200K 0Ms #include<iostream> using namespace std; int ...
- poj 3094 Quicksum
#include <stdio.h> #include <string.h> ]; int main() { ; int i,len; while(gets(word)) { ...
- POJ 3286 How many 0's?(几多0?)
POJ 3286 How many 0's?(几多0?) Time Limit: 1000MS Memory Limit: 65536K [Description] [题目描述] A Benedi ...
- POJ 1094 Sorting It All Out 拓扑排序 难度:0
http://poj.org/problem?id=1094 #include <cstdio> #include <cstring> #include <vector& ...
- POJ 2240 && ZOJ 1082 Arbitrage 最短路,c++ stl pass g++ tle 难度:0
http://poj.org/problem?id=2240 用log化乘法为加法找正圈 c++ 110ms,g++tle #include <string> #include <m ...
- POJ 1125 Stockbroker Grapevine 最短路 难度:0
http://poj.org/problem?id=1125 #include <iostream> #include <cstring> using namespace st ...
- POJ 2253 Frogger 最短路 难度:0
http://poj.org/problem?id=2253 #include <iostream> #include <queue> #include <cmath&g ...
随机推荐
- bootstrap 图片轮播效果
<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="http: ...
- poj2354Titanic(两点的球面距离)
链接 球面距离计算公式:d(x1,y1,x2,y2)=r*arccos(sin(x1)*sin(x2)+cos(x1)*cos(x2)*cos(y1-y2)) x1,y1是纬度\经度的弧度单位,r为地 ...
- Python学习(20)python操作mysql数据库_安装
win7系统下python3.4连接mysql数据库 1.到python官方网站下载最新python程序.根据系统有32,64位. 直接下一步,就可以安装成功. 2.在python官网中去下载 ...
- HTML字符实体
常用实体符号:
- GCC编译器和GDB调试器常用选项
http://blog.csdn.net/u014328976/article/details/46745349 GCC编译器 gcc hello.c -o hello ...
- android 回调函数的使用
// activity 之间方法调用的桥梁 public class ActivityCallBridge { static ActivityCallBridge mBridge; private O ...
- 【服务器防护】WEB防护 - WEBSHELL攻击探测【转载】
原文:http://www.2cto.com/Article/201511/451757.html 1. 什么是webshell? 基于b/s架构的软件部署在Internet上,那么安全性是必 ...
- Sqlserver_In、exists使用
in是把外表和内表作hash 连接,而exists 是对外表作loop 循环,每次loop 循环再对内表进行查询. 一直以来认为exists 比in 效率高的说法是不准确的.如果查询的两个表大小相当, ...
- Css3_必备10个东西
1.边框圆角(Border Radiuas) 这个是我们在平常很常用的吧,以前我在用div圆角的时候,特别特别的痛苦,不管是用CSS来画圆角,还是用图片来画圆角都不那么容易,但是现在好了,在CSS3中 ...
- hiho_1041 国庆出游
题目 给定一棵树,N个节点,N - 1条边.给定m个节点,能否找出一种遍历方法,使得首次到达节点ai的时间小于首次到达节点aj的时间(i < j).且经过的路径上的每条边都最多走两遍 分析 我的 ...