time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Matthew is given two strings a𝑎 and b𝑏, both of length 33. He thinks it's particularly funny to create two new words by swapping the first character of a𝑎 with the first character of b𝑏. He wants you to output a𝑎 and b𝑏 after the swap.
Note that the new words may not necessarily be different.
Input
The first line contains t𝑡 (1≤t≤1001≤𝑡≤100) --- the number of test cases.
The first and only line of each test case contains two space-separated strings, a𝑎 and b𝑏, both of length 33. The strings only contain lowercase Latin letters.
Output
For each test case, after the swap, output a𝑎 and b𝑏, separated by a space.
Example
input
Copy
6
bit set
cat dog
hot dog
uwu owo
cat cat
zzz zzz
output
Copy
sit bet
dat cog
dot hog
owu uwo
cat cat
zzz zzz
解题说明:字符串题目,直接取值然后颠倒输出即可。
cpp
#include<stdio.h>
int main()
{
int n;
scanf("%d", &n);
while (n--)
{
char c[5], p[5];
scanf("%s %s", c, p);
char temp = c[0];
c[0] = p[0];
p[0] = temp;
printf("%s %s\n", c, p);
}
return 0;
}