BestCoder#15 A-LOVE

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

BestCoder Round #15

水题,没思想,不过用java写稍微快点

 1 import java.io.*;
 2 import java.util.*;
 3 import java.text.*;
 4 public class BestCoder15 {
 5     public static void main(String[] args){
 6         Scanner sc = new Scanner(new InputStreamReader(System.in));
 7
 8         while(sc.hasNextLine()){
 9             String s1 = new String(sc.nextLine());
10             String s2 = new String(sc.nextLine());
11
12             String[] str1 = s1.split("_");
13             String[] str2 = s2.split("_");
14
15             System.out.println(str1[1] + "_small_" + str2[1]);
16         }
17         sc.close();
18     }
19 }

时间: 2024-10-29 20:01:18

BestCoder#15 A-LOVE的相关文章

BestCoder Round#15 1001-Love

http://acm.hdu.edu.cn/showproblem.php?pid=5082 Love Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 64    Accepted Submission(s): 51 Problem Description There is a Love country with many couples

hdu 5083 Instruction(Bestcoder Round #15)

Instruction                                                               Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 327    Accepted Submission(s): 94 Problem Description Nowadays, Jim Gre

BestCoder Round#15 1002-Instruction

http://acm.hdu.edu.cn/showproblem.php?pid=5083 官方题解——> 1002 Instruction 先考虑编码,首先找到operation对应的编码,如果是SET就找后面的一个R后面跟着的数字a,令b=0,否则找后面第一个R后面的数字当作a,第二个R后面的数字当作b,最后依次输出operation二进制编码,a, b的二进制编码. 再说解码,先将前6位,中间5位和后面5位转化成十进制记为oid, a, b.如果oid<1||oid>6就是Err

hdu 5082 Love(Bestcoder Round #15)

Love Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 78    Accepted Submission(s): 57 Problem Description There is a Love country with many couples of Darby and Joan in it. In order to commemor

【BestCoder】【Round#42】

模拟+链表+DP Orz AK爷faebdc A Growin要跟全部的n个人握手共2n杯香槟,再加上每对关系的两杯香槟,直接统计邻接矩阵中1的个数,再加2n就是answer 1 //BestCoder 42 A 2 #include<vector> 3 #include<cstdio> 4 #include<cstring> 5 #include<cstdlib> 6 #include<iostream> 7 #include<algor

BestCoder Round #11 (Div. 2) 前三题题解

题目链接: huangjing hdu5054 Alice and Bob 思路: 就是(x,y)在两个參考系中的表示演全然一样.那么仅仅可能在这个矩形的中点.. 题目: Alice and Bob Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 216    Accepted Submission(s): 166 Problem De

BestCoder Round #11 (Div. 2) 题解

HDOJ5054 Alice and Bob Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 302    Accepted Submission(s): 229 Problem Description Bob and Alice got separated in the Square, they agreed that if they

BestCoder3 1002 BestCoder Sequence(hdu 4908) 解题报告

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4908 题目意思:给出 一个从1~N 的排列你和指定这个排列中的一个中位数m,从这个排列中找出长度为奇数,中位数是m的子序列有多少个. 我的做法被discuss 中的测试数据一下子就否定了. 这个是别人的做法,暂时留下来,有些地方还没真正弄懂,应该是缺了部分的知识没有学到... 留着先: (1)http://blog.csdn.net/hcbbt/article/details/38377815 (2

BestCoder Round #4 前两题 hdu 4931 4932

第一题太水了.. 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<algorithm> 5 using namespace std; 6 int a[6]; 7 int main(){ 8 int cas; 9 scanf( "%d", &cas ); 10 while( cas-- ){ 11 for( int i = 0; i <