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. hdu3038(带权并查集)

    题目链接: http://acm.split.hdu.edu.cn/showproblem.php?pid=3038 题意: n表示有一个长度为n的数组, 接下来有m行形如x, y, d的输入, 表示 ...

  2. hdu2302(枚举,大数取模)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2303 题意:给出两个数k, l(4<= k <= 1e100, 2<=l<=1 ...

  3. WebService - 怎样提高WebService性能 大数据量网络传输处理

    直接返回DataSet对象 返回DataSet对象用Binary序列化后的字节数组 返回DataSetSurrogate对象用Binary序列化后的字节数组 返回DataSetSurrogate对象用 ...

  4. 【Jquery】【控件】flexigrid 自定义查询

    最近用flexigrid作报表,需要自定义条件进行查询,界面如下: 翻了半天文档也没找到如何用POST方法自行传递参数进行查询. 找了一个台湾人写的博客,却要改flexigrid的源代码,更不靠谱. ...

  5. 【转载】 Python 调整屏幕分辨率

    转载来自: http://www.cnblogs.com/fatterbetter/p/4115423.html 需要用windows的api,ChangeDisplaySettings 实现代码如下 ...

  6. hdu 4045 2011北京赛区网络赛F 组合数+斯特林数 ***

    插板法基础知识 斯特林数见百科 #include<iostream> #include<cmath> #include<cstdio> #include<cs ...

  7. C程序设计语言习题解答

    1-6 #include <stdio.h> int main(void) { printf("getchar()!=EOF is:%d\n", getchar()!= ...

  8. 在Salesforce中可以对某一个Object的Standard Button或Link进行重写

    在Salesforce中可以对某一个Object的Standard Button或Link进行重写,来实现我们特定的逻辑过程,比如:在删除某个Object之前要判断该Object的某个Field的状态 ...

  9. HDU 3586 Information Disturbing 树形DP+二分

    Information Disturbing Problem Description   In the battlefield , an effective way to defeat enemies ...

  10. POJ 1947 Rebuilding Roads 树形DP

    Rebuilding Roads   Description The cows have reconstructed Farmer John's farm, with its N barns (1 & ...