Love

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 123    Accepted Submission(s): 90

Problem Description
There 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.
 
Input
Multi test cases (about 10), every case contains two lines. 
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].

 
Output
For each case, output their offspring’s name in a single line in the format [first name of male]_small_[first name of female].
 
Sample Input
Jim_Green
Alan_Blue
 
Sample Output
Green_small_Blue
 
Source
 水题,没思想,不过用java写稍微快点
 import java.io.*;
import java.util.*;
import java.text.*;
public class BestCoder15 {
public static void main(String[] args){
Scanner sc = new Scanner(new InputStreamReader(System.in)); while(sc.hasNextLine()){
String s1 = new String(sc.nextLine());
String s2 = new String(sc.nextLine()); String[] str1 = s1.split("_");
String[] str2 = s2.split("_"); System.out.println(str1[1] + "_small_" + str2[1]);
}
sc.close();
}
}

BestCoder#15 A-LOVE(暴力)的更多相关文章

  1. HDU 5908 Abelian Period (BestCoder Round #88 模拟+暴力)

    HDU 5908 Abelian Period (BestCoder Round #88 模拟+暴力) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=59 ...

  2. project euler 开坑

    pe76: 要把100写成至少2个数的和的形式,有多少种方案数 整数拆分 f(i,j)表示把i拆分成不超过j的数的和的方案数 f(i,j) = f(i-j,j) + f(i,j-1)  j <= ...

  3. 转载 Appstore 上传被拒原因及解释

    原 apps被拒绝的各种理由以及翻译 1. Terms and conditions(法律与条款) 2. Functionality(功能) 3. Metadata (name, descriptio ...

  4. iOS提交AppStore被拒原因

    1. Terms and conditions(法律与条款) 1.1 As a developer of applications for the App Store you are bound by ...

  5. app被Rejected 的各种原因翻译

    1. Terms and conditions(法律与条款) 1.1 As a developer of applications for the App Store you are bound by ...

  6. A very hard Aoshu problem

    A very hard Aoshu proble Problem Description Aoshu is very popular among primary school students. It ...

  7. Codeforces Round #306 (Div. 2) ABCDE(构造)

    A. Two Substrings 题意:给一个字符串,求是否含有不重叠的子串"AB"和"BA",长度1e5. 题解:看起来很简单,但是一直错,各种考虑不周全, ...

  8. app被Rejected 的各种原因翻译。这个绝对有用。

    1. Terms and conditions(法律与条款) 1.1 As a developer of applications for the App Store you are bound by ...

  9. ios 项目被拒绝各种理由

    . Terms and conditions(法律与条款) 1.1 As a developer of applications for the App Store you are bound by ...

随机推荐

  1. windows一个目录下最大文件数目

    对于FAT16文件系统, 可以保存的文件体积最大值是 4 GB - 1 byte (2^32 bytes - 1 byte): 卷的最大体积是4GB:每个卷上最多可以保存的文件数量是65,536个 ( ...

  2. Swift - 初始化Initialization

    Ps:苹果官方文档-Initialization 自定义控件初始化中常见的几种错误(指定构造器和便利构造器)截图:   意思是:1.没有添加重写符override(重写父类方法)2.没有重写initW ...

  3. 4.1 pair类模板

    在学习关联容器之前,首先先要了解一下STL中的pair类模板,因为关联容器的一些成员函数返回值都是pair对象,而且map 和multimap中的元素都是pair对象. 1)pair类模板定义 pai ...

  4. 有关struts2中用到 js 总结

    1.js中取Struts2中的栈里的值 var current = "${currentPage}"; 2.js 如何提交执行提交url连接 ,以及 Struts中的url如何如何 ...

  5. mysqli扩展库的预处理技术 mysqli stmt

    //预编译演示 //1,创建mysqli对象 $mysqli=new mysqli("localhost","root",""," ...

  6. Android -- Looper、Handler、MessageQueue等类之间关系的序列图

    原文:Android源码解析之(二)-->异步消息机制 通过阅读文章及其中提到的一些参考文章,模模糊糊的理解了Android的异步消息机制.为了能够进行消化吸收,决定把各类之间的交互通过图的形式 ...

  7. C#的Attribute

    using System; using System.Collections; using System.Collections.Generic; using System.IO; namespace ...

  8. SVN的忽略和只读使用方法学习记录

    前言,先扯几句.最近学了GIT,虽然很肤浅,但是也算是用上了分布式版本管理控制系统.Linus很牛,他也很厌烦SVN,而我看这些都是工具,是否拿来使用主要看是否顺手.我赞同分布式版本管理控制,它有诸多 ...

  9. Solr入门之(4)配置文件solr.xml

    <?xml version="1.0" encoding="UTF-8" ?> <!-- This is an example of a si ...

  10. 使用nbrbutil工具來處理requested media id is in use, cannot process request

    首先我發現一個Media已經過期很久,但是并不會覆蓋重用 使用bpexpdate手動過期,失敗,讓他deassigned也不行 使用bpimmedia查看上面的image也沒有 我嘗試手動去過期,返回 ...