hdu-5082
题意非常easy,就是给出父母的名字,然后依据父母的名字来给孩纸取名字!
能够将此题简化为:
孩纸的名字=父亲的frist name+字符串(_small_)+母亲额frist name;
然后将孩纸的名字输出就可以!
代码例如以下:
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
char ord[100]={"_small_"};
int main()
{
char fa[50],mo[70];
while(scanf("%s%s",fa,mo)!=EOF)
{
char na[40];
int pos1,pos2;
for(int i=0;i<strlen(fa);i++)
if(fa[i]=='_')
{
pos1=i+1;
break;
}
for(int i=0;i<strlen(mo);i++)
if(mo[i]=='_')
{
pos2=i+1;
break;
}
int cnt=0;
for(int i=pos1;i<strlen(fa);i++)
na[cnt++]=fa[i];
for(int i=0;i<strlen(ord);i++)
na[cnt++]=ord[i];
for(int i=pos2;i<strlen(mo);i++)
na[cnt++]=mo[i];
na[cnt]='\0';
cout<<na<<endl;
}
return 0;
}
hdu-5082的更多相关文章
- hdu 5082(水题)
Love Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...
- HDOJ 2111. Saving HDU 贪心 结构体排序
Saving HDU Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- 【HDU 3037】Saving Beans Lucas定理模板
http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...
- hdu 4859 海岸线 Bestcoder Round 1
http://acm.hdu.edu.cn/showproblem.php?pid=4859 题目大意: 在一个矩形周围都是海,这个矩形中有陆地,深海和浅海.浅海是可以填成陆地的. 求最多有多少条方格 ...
- HDU 4569 Special equations(取模)
Special equations Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u S ...
- HDU 4006The kth great number(K大数 +小顶堆)
The kth great number Time Limit:1000MS Memory Limit:65768KB 64bit IO Format:%I64d & %I64 ...
- HDU 1796How many integers can you find(容斥原理)
How many integers can you find Time Limit:5000MS Memory Limit:32768KB 64bit IO Format:%I64d ...
- hdu 4481 Time travel(高斯求期望)(转)
(转)http://blog.csdn.net/u013081425/article/details/39240021 http://acm.hdu.edu.cn/showproblem.php?pi ...
- HDU 3791二叉搜索树解题(解题报告)
1.题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=3791 2.参考解题 http://blog.csdn.net/u013447865/articl ...
- hdu 4329
problem:http://acm.hdu.edu.cn/showproblem.php?pid=4329 题意:模拟 a. p(r)= R'/i rel(r)=(1||0) R ...
随机推荐
- Sentinel-1雷达数据可以免费下载
The Sentinel-1 Scientific Data Hub(https://scihub.esa.int )网站提供免费下载 Sentinel-1雷达数据Level-0 和 Level-1级 ...
- rdlc部署zt
原文:rdlc部署zt 偶然间遇到“ 未能加载文件或程序集microsoft.reportviewer.winforms ……”的一个错误,以前web是遇到过,没想到winform部署也会遇到.找了半 ...
- REST Web Server,REST介绍
参考资料: 1.http://www.chinalivedoor.com/story/1123.html 2. Backbone.js 是一种重量级javascript MVC 应用框架,通过Mod ...
- jquery去除字符串首尾空格的方法:$.trim()
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- Jquery操作-(多种实例)--未完
一.Jquery简介 定义 jQuery创始人是美国John Resig,是优秀的Javascript框架: jQuery是一个轻量级.快速简洁的javaScript库. jQuery对象 jQuer ...
- android-vlc for rtsp build OK
近期研究 rtsp http stream 流获取方式 vlc over live555 是个很不错的选择,当然了 andorid framework av也是支持rtsp http的,相同不错的选 ...
- 用事件与CSS改变按钮不同状态下的颜色
目标效果: 表单的群发按钮,在鼠标悬停时为深蓝色,鼠标离开时为淡蓝色. HTML代码: <button id="submitBtn" class="btn&quo ...
- 跨文档消息传递----postMessage()
HTML5 规范中,提出了XDM,又称为 跨文档消息传递,其核心是 postMessage()方法,进行跨域和跨文档消息传递,示例如下: <div class="CrossDocume ...
- 查找EBS中各种文件版本(Finding File Versions in the Oracle Applications EBusiness Suite - Checking the $HEADER)
Finding File Versions in the Oracle Applications EBusiness Suite - Checking the $HEADER (文档 ID 85895 ...
- TCP/IP的三次握手协议
关于TCP/IP的三次握手协议,这篇文章中有详细的介绍,很通俗易懂,什么时候忘了,都可以过来瞧两眼,保证很快就明白了. 首先TCP/IP协议分为三个阶段:建立连接(握手阶段),数据传输阶段,连接终止阶 ...