Love
Time Limit: 2000/1000 MS (Java/others) memory limit: 32768/32768 K (Java/Others)
Total submission (s): 123 accepted submission (s): 90
Problem descriptionthere is a love country with your 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.
Inputmulti 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 shoshould not be empty, as well as [first name].
Outputfor each case, output their offspring's name in a single line in the format [First Name of male] _ small _ [First Name of Female].
Sample inputjim_greenalan_blue
Sample outputgreen_small_blue
Sourcebestcoder round #15 questions, no idea, but use Java to write a little faster
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 }View code
Bestcoder # A-LOVE