hdu 5082(水题)
Love
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 875 Accepted Submission(s): 536
is a Love country with many couples of Darby and Joan in it. In order
to commemorate their love, they will do some thing special when giving
name to their offspring.
When a couple want to give name to their
offspring, they will firstly get their first names, and list the one of
the male before the one of the female. Then insert the string “small”
between their first names. Thus a new name is generated. For example,
the first name of male is Green, while the first name of the female is
Blue, then the name of their offspring is Green small Blue.
You are expected to write a program when given the name of a couple, output the name of their offsping.
The first line lists the name of the male.
The second line lists the name of the female.
In each line the format of the name is [given name]_[first name].
Please process to the end of file.
[Technical Specification]
3 ≤ the length of the name ≤ 20
[given name] only contains alphabet characters and should not be empty, as well as [first name].
Alan_Blue
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <algorithm>
#include <string.h>
using namespace std; int main()
{
char s1[],s2[];
while(scanf("%s %s",s1,s2)!=EOF){
int len1 = strlen(s1);
int len2 = strlen(s2);
int cnt = ,cnt1 = ;
bool flag = false;
for(int i=;i<len1;i++){
if(s1[i]=='_') flag = true,i++;
if(flag){
s1[cnt++] = s1[i];
}
}
flag = false;
for(int i=;i<len2;i++){
if(s2[i]=='_') flag = true,i++;
if(flag){
s2[cnt1++] = s2[i];
}
}
for(int i=;i<cnt;i++) printf("%c",s1[i]);
printf("_small_");
for(int i=;i<cnt1;i++) printf("%c",s2[i]);
printf("\n");
}
return ;
}
hdu 5082(水题)的更多相关文章
- HDU-1042-N!(Java大法好 && HDU大数水题)
N! Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Total Subm ...
- HDU 5391 水题。
E - 5 Time Limit:1500MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64u Submit Statu ...
- hdu 1544 水题
水题 /* * Author : ben */ #include <cstdio> #include <cstdlib> #include <cstring> #i ...
- HDU排序水题
1040水题; These days, I am thinking about a question, how can I get a problem as easy as A+B? It is fa ...
- hdu 2710 水题
题意:判断一些数里有最大因子的数 水题,省赛即将临近,高效的代码风格需要养成,为了简化代码,以后可能会更多的使用宏定义,但是通常也只是快速拿下第一道水题,涨自信.大部分的代码还是普通的形式,实际上能简 ...
- Dijkstra算法---HDU 2544 水题(模板)
/* 对于只会弗洛伊德的我,迪杰斯特拉有点不是很理解,后来发现这主要用于单源最短路,稍稍明白了点,不过还是很菜,这里只是用了邻接矩阵 套模板,对于邻接表暂时还,,,没做题,后续再更新.现将这题贴上,应 ...
- hdu 5162(水题)
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5162 题解:看了半天以为测试用例写错了.这题玩文字游戏.它问的是当前第i名是原数组中的第几个. #i ...
- hdu 3357 水题
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3357 #include <cstdio> #include <cmath> # ...
- hdu 5038 水题 可是题意坑
http://acm.hdu.edu.cn/showproblem.php?pid=5038 就是求个众数 这个范围小 所以一个数组存是否存在的状态即可了 可是这句话真恶心 If not all ...
随机推荐
- 对于STM32别名区的理解 (转载)
1. 什么是位段.位带别名区? 2. 它有什么好处? 答1: 是这样的,记得MCS51吗? MCS51就是有位操作,以一位(BIT)为数据对象的操作, MCS51可以简单的将P1口的第2位 ...
- svn TortoiseSVN 回滚版本
原文链接: http://keenwon.com/1072.html SVN是一个版本管理工具,在工作中经常使用,尤其是多人合作开发的时候,版本管理显得更加重要.需要使用回退的场景往往都比较" ...
- django之python3.4及以上连接mysql的一些问题记录
首先,祭出大杀器whl https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysqlclient django1.x与django2.x 在项目的写法上有一些区别 ...
- echart图表展示数据-简单的柱状图
话不多说,先上几张效果图 给大家看看 1:echart所用到的文件包需要事先引入好具体可见 http://echarts.baidu.com/doc/start.html 2:本例中所有的数据都是通过 ...
- 基于mysqldump备份集来恢复某个误操作的表(drop,truncate)
Preface How to rescue a dropped or truncated table online?Dropping or truncating is ddl oper ...
- 洛谷P1071潜伏者(提高组)
题目描述 R国和S国正陷入战火之中,双方都互派间谍,潜入对方内部,伺机行动.历尽艰险后,潜伏于S国的R 国间谍小C终于摸清了 S 国军用密码的编码规则: 1. S国军方内部欲发送的原信息经过加密后在网 ...
- H5调试
在PC上的调试 问题:需要调试样式,没有数据不方便调试. 方案:本地mock. EG: chrome书签管理器 →将下面代码存书签里,如下图: javascript: void function() ...
- HTTP 返回状态代码详细解释
一:1xx(临时响应)表示临时响应并需要请求者继续执行操作的状态代码. 100(继续)请求者应当继续提出请求. 服务器返回此代码表示已收到请求的第一部分,正在等待其余部分:101(切换协议)请求者已要 ...
- 思梦PHP-阿里大鱼手机验证码
小伙伴是否做PC网站的时候,是否遇到过注册用户需要使用短信验证的功能呢?或者找回密码,以及验证用户的信息等等功能!今天思梦PHP就为大家带来ThinkPHP整合阿里大鱼短信验证的功能! 首先,我们要明 ...
- Dev express 笔记
1.设置treelist不同行的颜色 void treeList1_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDr ...