HDU 2719 The Seven Percent Solution (水题。。。)
题意:把字符串中的一些特殊符号用给定的字符串代替。
析:没的说。
代码如下:
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstring>
#include <map> using namespace std;
const int maxn = 100;
char s[maxn]; int main(){
while(gets(s) && s[0] != '#'){
int n = strlen(s);
for(int i = 0; i < n; ++i){
if(' ' == s[i]) printf("%%20");
else if('!' == s[i]) printf("%%21");
else if('$' == s[i]) printf("%%24");
else if('%' == s[i]) printf("%%25");
else if('(' == s[i]) printf("%%28");
else if(')' == s[i]) printf("%%29");
else if('*' == s[i]) printf("%%2a");
else printf("%c", s[i]);
}
printf("\n");
}
return 0;
}
HDU 2719 The Seven Percent Solution (水题。。。)的更多相关文章
- HDU 2719 The Seven Percent Solution
#include <cstdio> #include <cstring> int main() { ]; ]!='#') { ; while (i<strlen(s)) ...
- HDU 2096 小明A+B --- 水题
HDU 2096 /* HDU 2096 小明A+B --- 水题 */ #include <cstdio> int main() { #ifdef _LOCAL freopen(&quo ...
- [HDU 2602]Bone Collector ( 0-1背包水题 )
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2602 水题啊水题 还给我WA了好多次 因为我在j<w[i]的时候状态没有下传.. #includ ...
- hdu 2117:Just a Numble(水题,模拟除法运算)
Just a Numble Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Tot ...
- hdu 2050:折线分割平面(水题,递归)
折线分割平面 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Subm ...
- hdu 2044:一只小蜜蜂...(水题,斐波那契数列)
一只小蜜蜂... Time Limit: / MS (Java/Others) Memory Limit: / K (Java/Others) Total Submission(s): Accepte ...
- HDU 4706 Children's Day (水题)
Children's Day Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)To ...
- hdu 1201:18岁生日(水题,闰年)
18岁生日 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submi ...
- hdu 2025:查找最大元素(水题,顺序查找)
查找最大元素 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Subm ...
随机推荐
- 使用 C++11 编写类似 QT 的信号槽——下篇
要实现 Signal-Slot,Signal 类中应该拥有一个保存 std::function 的数组: template<class FuncType> class Signal { p ...
- UI5-文档-4.32-Routing with Parameters
现在我们可以在overview和detail页面之间导航,但是我们在overview中选择的实际项目还没有显示在detail页面上.我们的应用程序的一个典型用例是在详细信息页面上显示所选项目的附加信息 ...
- .Net 常用开发工具
,net常用开发工具 LinqPad使用 LinqPad连接Oracle 使用 LINQPad 将linq转换为 lambda表达式 或者 SQL语句 LINQPad 4 初次使用心得 一.双击 二. ...
- Python之类属性的增删改查
#类属性又称为静态变量,或者是静态数据,这些数据是他们所属的类对象绑定的,不依赖于任何类实例 class ChinesePeople: country = 'china' def __init__(s ...
- find命令之时间戳使用示例
查看当前目录以及子目录下哪些文件占用的空间最大: find ./ -type f -exec du -m {} \; | sort -nr | head find ./ -type f ...
- Quartz+TopShelf实现Windows服务作业调度
Quartz:首先我贴出来了两段代码(下方),可以看出,首先会根据配置文件(quartz.config),包装出一个Quartz.Core.QuartzScheduler instance,这是一个调 ...
- scala -- 层级
层级 层级的顶端是Any 类,定义了如下方法 final def ==(that:Any):Boolean final def !=(that:Any):Boolean def equals(that ...
- struts2 自带的 token防止表单重复提交拦截器
在struts2中,我们可以利用struts2自带的token拦截器轻松实现防止表单重复提交功能! 1. 在相应的action配置中增加: <interceptor-ref name=&quo ...
- 103041000997维护的是周批,按周合并后再考虑最小采购批量、舍入值、然后回写到SAP系统
描述:103041000997维护的是周批量,但最终没有按周批量来回写数据. 业务逻辑如下: 1.净需求考虑数量按周汇总(也有按日.按3天,具体 要根据物料主数据维护来判断) 2.第1点的结果再加上安 ...
- Django之ORM使用以及模板语言
一.ORM版增删改查 1.ORM的语句 1.类名.objects.all() --> 返回一个列表 2.类名.objects.filter() --> 返回一 ...