poj 1298 The Hardest Problem Ever
题目链接:http://poj.org/problem?id=1298
题目大意:按照所给的顺序要求将输入的字符串进行排列。
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main ()
{
char str[]= {"VWXYZABCDEFGHIJKLMNOPQRSTU"};
char ch[]; while ()
{
gets(ch);
if (strcmp(ch,"START")==)//strcmp是字符的一个函数,也就是两者之间的比较
continue;
else if (strcmp(ch,"END")==)
continue;
else if (strcmp(ch,"ENDOFINPUT")==)
break;
for (int i=; ch[i]!='\0'; i++)
{
if (!(ch[i]>='A'&&ch[i]<='Z'))
continue;
ch[i]=str[ch[i]-];//运用ASCII进行字符之间的相互转换
}
puts(ch);
}
return ;
}
poj 1298 The Hardest Problem Ever的更多相关文章
- POJ 1298 The Hardest Problem Ever【字符串】
Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was ke ...
- 1298 The Hardest Problem Ever
题目链接:http://poj.org/problem?id=1298 思路分析:水题,字符偏移求解,注意字符串输入问题即可. 代码如下: #include <iostream> #inc ...
- HDU1048The Hardest Problem Ever
The Hardest Problem Ever Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & ...
- The Hardest Problem Ever(字符串)
The Hardest Problem Ever Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 24039 Accept ...
- (字符串 枚举)The Hardest Problem Ever hdu1048
The Hardest Problem Ever 链接:http://acm.hdu.edu.cn/showproblem.php?pid=1048 Time Limit: 2000/1000 MS ...
- HDUOJ-------The Hardest Problem Ever
The Hardest Problem Ever Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java ...
- POJ.3468 A Simple Problem with Integers(线段树 区间更新 区间查询)
POJ.3468 A Simple Problem with Integers(线段树 区间更新 区间查询) 题意分析 注意一下懒惰标记,数据部分和更新时的数字都要是long long ,别的没什么大 ...
- poj 1298(水题)
The Hardest Problem Ever Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 24241 Accept ...
- POJ 3468.A Simple Problem with Integers-线段树(成段增减、区间查询求和)
POJ 3468.A Simple Problem with Integers 这个题就是成段的增减以及区间查询求和操作. 代码: #include<iostream> #include& ...
随机推荐
- ubuntu 16.04 安装jdk9错误
转自:https://askubuntu.com/questions/769467/can-not-install-openjdk-9-jdk-because-it-tries-to-overwrit ...
- 获取当前路径下的所有文件路径 :listFiles
获取当前路径下的所有文件路口 :listFiles
- POJ2186:Popular Cows——题解
http://poj.org/problem?id=2186 题面纯英文--就不粘题面了. 简单的说,就是将图强连通分量缩点,然后拓扑一下. 为了避免拓扑,我们可以反向存图,然后查入度为0的点即可. ...
- [usaco] 2008 Dec Largetst Fence 最大的围栏 2 || dp
原网站大概已经上不了了-- 题目大意: 求出平面上n个点组成的一个包含顶点数最多的凸多边形.n<=250. 考虑我们每次枚举凸包的左下角为谁(参考Graham求凸包时的左下角),然后像Graha ...
- 洛谷 P2906 [USACO08OPEN]牛的街区Cow Neighborhoods | Set+并查集
题目: https://www.luogu.org/problemnew/show/P2906 题解: 垃圾水题 #include<cstdio> #include<algorith ...
- codevs5037 线段树练习4加强版(暴力分块)
求大爷教线段树怎么写啊QAQ 只会写分块...一开始脑抽写成了O(NKlogN)还被CZL大爷嘲讽了一发T T f[i][j]表示在第i块中,模k为j的数有几个,然后每次修改的时候只需要打个标记,查询 ...
- bzoj1051: [HAOI2006]受欢迎的牛(tarjan强连通分量)
强连通缩下点,出度为0有多个答案为0,否则答案为出度为0的强连通分量中点的个数. 发现一道tarjan模板题,顺便复习一波tarjan #include<iostream> #includ ...
- 面向小数据集构建图像分类模型Keras
文章信息 本文地址:http://blog.keras.io/building-powerful-image-classification-models-using-very-little-data. ...
- HDU1078记忆化搜索
FatMouse and Cheese Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Othe ...
- c# MD5盐值加密
using System; using System.Collections.Generic; using System.Linq; using System.Security.Cryptograph ...