PPAP

PPAP

Time Limit: 1 Second       Memory Limit: 65536 KB

"I have a pen. I have an apple. Uh! Applepen."

"I have a pen. I have pineapple. Uh! Pineapplepen."

The above lyrics are taken from PPAP, a single by Pikotaro. It was released as a music video on YouTube on 25 August 2016, and has since become a viral video. As of October 2017, the official video has been viewed over 126 million times.

Let's view this song from a mathematical perspective. In the lyrics there actually hides a function , which takes two lowercased string  and  as the input and works as follows:

  • First, calculate  ( here means string concatenation).
  • Then, capitalize the first character of  to get .
  • Make  as its output, and the function is done.

For example, we have PPAP("pen", "apple") = "Applepen", and PPAP("pen", "pineapple") = "Pineapplepen".

Given two lowercased strings  and , your task is to calculate .

Input

The first line of the input contains an integer  (about 100), indicating the number of test cases. For each test case:

The first and only line contains two strings  and  () separated by one space. It's guaranteed that both  and  consist of only lowercase English letters.

Output

For each test case output one line containing one string, indicating .

Sample Input
3
pen apple
pen pineapple
abc def
Sample Output
Applepen
Pineapplepen
Defabc

题意:输入n行,每行两个字符串,后面的一个排在前面并且首字母大写,然后连接第一个字符串,输出。
题解:模拟
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string a,b;
    int n;
    cin>>n;
    while(n--)
    {
        cin>>a>>b;
        b+=a;///连接字符串
        b[0]-=32;///首字母大写
        cout<<b<<endl;
    }
    return 0;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

落凡尘.

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值