【CUGBACM15级BC第15场 A】hdu 5083 Love
2017-08-07 21:13
399 查看
Love
[align=center]Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 990 Accepted Submission(s): 620
[/align]
[align=left]Problem Description[/align]
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.
[align=left]Input[/align]
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].
[align=left]Output[/align]
For each case, output their offspring’s name in a single line in the format [first name of male]_small_[first name of female].
[align=left]Sample Input[/align]
Jim_Green
Alan_Blue
[align=left]Sample Output[/align]
Green_small_Blue
题意:输出第一个字符串的名字+_small_+后一个字符串的名字
/* *********************************************** ┆ ┏┓ ┏┓ ┆ ┆┏┛┻━━━┛┻┓ ┆ ┆┃ ┃ ┆ ┆┃ ━ ┃ ┆ ┆┃ ┳┛ ┗┳ ┃ ┆ ┆┃ ┃ ┆ ┆┃ ┻ ┃ ┆ ┆┗━┓ 马 ┏━┛ ┆ ┆ ┃ 勒 ┃ ┆ ┆ ┃ 戈 ┗━━━┓ ┆ ┆ ┃ 壁 ┣┓┆ ┆ ┃ 的草泥马 ┏┛┆ ┆ ┗┓┓┏━┳┓┏┛ ┆ ┆ ┃┫┫ ┃┫┫ ┆ ┆ ┗┻┛ ┗┻┛ ┆ ************************************************ */ #include <iostream> #include <set> #include <map> #include <stack> #include <cmath> #include <queue> #include <cstdio> #include <bitset> #include <string> #include <vector> #include <iomanip> #include <cstring> #include <algorithm> #include <functional> #define PI acos(-1) #define eps 1e-8 #define inf 0x3f3f3f3f #define debug(x) cout<<"---"<<x<<"---"<<endl typedef long long ll; using namespace std; int main() { char a[25], b[25]; while (~scanf("%s", a)) { scanf("%s", b); int len = strlen(a), len1 = strlen(b); int i, j; for (i = 0; i < len; i++) if (a[i] == '_') { break; } for (j = 0; j < len1; j++) if (b[j] == '_') { break; } for (int l = i + 1; l < len; l++) { printf("%c", a[l]); } printf("_small_"); for (int l = j + 1; l < len1; l++) { printf("%c", b[l]); } printf("\n"); } return 0; } /************************************************ ┆ ┏┓ ┏┓ ┆ ┆┏┛┻━━━┛┻┓ ┆ ┆┃ ┃ ┆ ┆┃ ━ ┃ ┆ ┆┃ ┳┛ ┗┳ ┃ ┆ ┆┃ ┃ ┆ ┆┃ ┻ ┃ ┆ ┆┗━┓ ┏━┛ ┆ ┆ ┃ ┃ ┆ ┆ ┃ ┗━━━┓ ┆ ┆ ┃ AC代马 ┣┓┆ ┆ ┃ ┏┛┆ ┆ ┗┓┓┏━┳┓┏┛ ┆ ┆ ┃┫┫ ┃┫┫ ┆ ┆ ┗┻┛ ┗┻┛ ┆ ************************************************ */
相关文章推荐
- 【CUGBACM15级BC第15场 B】hdu 5082 Instruction
- 【CUGBACM15级BC第20场 B】hdu 5124 lines
- 【CUGBACM15级BC第23场 B】hdu 5147 Sequence II
- 【CUGBACM15级BC第六场 A】hdu 4981 Goffi and Median
- 【CUGBACM15级BC第六场 B】hdu 4982 Goffi and Squary Partition
- 【CUGBACM15级BC第9场 B】hdu 4994 Revenge of Nim
- 【CUGBACM15级BC第12场 A】【STL】hdu 5058 So easy
- 【CUGBACM15级BC第三场 A】hdu 4907 Task schedule
- 【CUGBACM15级BC第12场 B】hdu 5059 Help him
- 【CUGBACM15级BC第24场 A】hdu 5150 Sum Sum Sum
- 【CUGBACM15级BC第28场 A】hdu 5166 Missing number
- 【CUGBACM15级BC第五场 A】hdu 4956 Poor Hanamichi
- 【CUGBACM15级BC第33场 B】hdu 5187 zhx's contest
- 【CUGBACM15级BC第三场 B】hdu 4908 BestCoder Sequence
- 【CUGBACM15级BC第26场 A】hdu 5158 Have meal
- 【CUGBACM15级BC第17场 B】hdu 5101 Select
- 【CUGBACM15级BC第26场 B】hdu 5159 Card
- 【CUGBACM15级BC第21场 A】hdu 5138 CET-6 test
- 【CUGBACM15级BC第二场 A】hdu 4883 TIANKENG’s restaurant
- 【CUGBACM15级BC第28场 B】hdu 5167 Fibonacci