zoukankan      html  css  js  c++  java
  • 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]
     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写稍微快点
     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
  • 相关阅读:
    mysql 8 查询报错(sql_mode=only_full_group_by)
    docker安装mysql8版本后 客户端连接出现client does not support authentication...
    docker常用命令
    查看tomcat日志相关Linux命令
    java项目部署到linux服务器涉及的命令
    ehcache与redis对比
    JS中调用BigDecimal处理金额
    thymeleaf模板 th:href 踩坑
    汇总一些绝对有价值的解决方案,边学习边收集
    spring注解总结,spring注解大全
  • 原文地址:https://www.cnblogs.com/ya-cpp/p/4052493.html
Copyright © 2011-2022 走看看