题目传送门

 /*
字符串处理:是一道水题,但是WA了3次,要注意是没有加'\0'的字符串不要用%s输出,否则在多组测试时输出多余的字符
*/
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std; typedef long long ll;
const int MAXN = 1e2 + ;
const int INF = 0x3f3f3f3f;
char ss[MAXN];
char s[MAXN], t[MAXN]; int main(void) //BestCoder Round #43 1001 pog loves szh I
{
// freopen ("A.in", "r", stdin); int tt; scanf ("%d", &tt);
while (tt--)
{
scanf ("%s", ss + );
// printf ("%s\n", ss + 1);
int len = strlen (ss + );
// printf ("%s\n", ss + 1); continue;
int p1 = , p2 = ;
for (int i=; i<=len; ++i)
{
if (i & ) s[++p1] = ss[i];
else t[++p2] = ss[i];
} for (int i=; i<=p1; ++i) printf ("%c", s[i]);
puts ("");
for (int i=p2; i>=; --i) printf ("%c", t[i]);
puts (""); // if (tt) puts ("");
} return ;
}

字符串处理 BestCoder Round #43 1001 pog loves szh I的更多相关文章

  1. 贪心/二分查找 BestCoder Round #43 1002 pog loves szh II

    题目传送门 /* 贪心/二分查找:首先对ai%=p,然后sort,这样的话就有序能使用二分查找.贪心的思想是每次找到一个aj使得和为p-1(如果有的话) 当然有可能两个数和超过p,那么an的值最优,每 ...

  2. 暴力 BestCoder Round #41 1001 ZCC loves straight flush

    题目传送门 /* m数组记录出现的花色和数值,按照数值每5个搜索,看看有几个已满足,剩下 5 - cnt需要替换 ╰· */ #include <cstdio> #include < ...

  3. BestCoder Round #43

    T1:pog loves szh I(hdu 5264) 题目大意: 给出把AB两个字符串交叉拼起来的结果,求出原串. 题解: 不解释..直接每次+2输出. T2:pog loves szh II(h ...

  4. 贪心 BestCoder Round #39 1001 Delete

    题目传送门 /* 贪心水题:找出出现次数>1的次数和res,如果要减去的比res小,那么总的不同的数字tot不会少: 否则再在tot里减去多余的即为答案 用set容器也可以做,思路一样 */ # ...

  5. 暴力 BestCoder Round #46 1001 YJC tricks time

    题目传送门 /* 暴力:模拟枚举每一个时间的度数 详细解释:http://blog.csdn.net/enjoying_science/article/details/46759085 期末考结束第一 ...

  6. hdu 5264 pog loves szh I 水题

    pog loves szh I Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?p ...

  7. hdu 5265 pog loves szh II

    题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5265 pog loves szh II Description Pog and Szh are pla ...

  8. hdu 5264 pog loves szh I

    题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5264 pog loves szh I Description Pog has lots of stri ...

  9. hdu 5265 pog loves szh II STL

    pog loves szh II Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php? ...

随机推荐

  1. Codeforces Round #258 (Div. 2) B. Sort the Array(简单题)

    题目链接:http://codeforces.com/contest/451/problem/B --------------------------------------------------- ...

  2. CentOS 6.x ELK(Elasticsearch+Logstash+Kibana)

    CentOS 6.x ELK(Elasticsearch+Logstash+Kibana) 前言 Elasticsearch + Logstash + Kibana(ELK)是一套开源的日志管理方案, ...

  3. CF 234 C Weather(粗暴方法)

    C. Color Stripe time limit per test 2 seconds memory limit per test 256 megabytes input standard inp ...

  4. Scrum 每日站会

    站立式会议(Daily Scrum, 有时候我们直接叫做Daily Meeting)是Scrum敏捷软件开发方法学的实践之一,也是团队最容易实施的敏捷实践,实施成本低. 具体做法,团队成员每天固定时间 ...

  5. Vs2017添加引用时报错 未能正确加载“ReferenceManagerPackage”包。

    Vs2017添加引用时报错未能正确加载“ReferenceManagerPackage”包. 最近新装了2017,开始前几天还好, 可是最近在添加引用时,报错 -------------------- ...

  6. linux安装anaconda中的问题及解决办法

    安装过程: 0:在ananconda官网网站上下载anaconda的linux版本https://www.anaconda.com/download/: 1:linux上切换到下载目录后(用cd), ...

  7. 【iOS系列】-UIButton的非常规使用

    [iOS系列]-UIButton的非常规使用 主要介绍UIButton在开发中得小技巧,使用好了,可以达到很奇妙的效果. 1:设置按钮内边距属性,可以呈现出相框的效果 btn.contentEdgeI ...

  8. ubuntu中查看已安装软件包的方法

    ubuntu中查看已安装软件包的方法: 方法一:在新立得软件包管理器中,打到已安装,便可以看看有多少包被安装. 如果想把这些包的信息复制到一文件里,可用下面的方法. 方法二:在终端输入 sudo dp ...

  9. Using Python with TurboGears A complete web framework integrating several Python projects

    Using Python with TurboGears TurboGears is a Python web framework based on the ObjectDispatch paradi ...

  10. how to use datatables editor

    Basic initialisation Editor is a Create, Read, Update and Delete (CRUD) extension forDataTables that ...