C++ Strings
School Accuracy: 47.08% Submissions: 10220 Points: 0

Given two strings as input. Your task is to find the longer string of the two strings, display the length of the longer string and concatenate the two strings and display the concatenated string.

Input: 
First line of the input file contains an integer T which denotes the number of test cases. For each test case, there will be two lines. First line contains string A, and second line contains string B.

Output:
Corresponding to each test case, In the first line print the length of the longer string and In the second line print the string obtained by concatenating the two strings.

.Constraints:
1 <= T <= 10
1 <= length(A) <= 100
1 <= length(B) <= 100

Example:
Input:
1
Geeks
forGeeks

Output:
8
GeeksforGeeks

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.