A. Creating Words

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;
}
相关推荐
拳里剑气6 小时前
C++算法:BFS解决FloodFill算法
c++·算法·bfs·宽度优先
wanderist.8 小时前
Lambda表达式在算法竞赛中的应用
java·开发语言·算法
稚南城才子,乌衣巷风流9 小时前
支配树(Dominator Tree)详解:概念、算法与应用
算法
稚南城才子,乌衣巷风流9 小时前
动态开点:原理、实现与应用场景
数据结构·算法
yyds_yyd_100869 小时前
1464. 数组中两元素的最大乘积(2026.07.27)
数据结构·c++·算法·leetcode
KaMeidebaby10 小时前
卡梅德生物技术快报 | 核酸适配体文库测序:核酸适配体文库测序的技术原理、实验流程与数据解析
前端·网络·数据库·人工智能·算法
geovindu11 小时前
CSharp: Breadth First Search Algorithm and Depth First Search Algorithm
开发语言·后端·算法·c#·.net·搜索算法
ekkoalex12 小时前
训练框架以及算法实现的框架
算法
DFT计算杂谈12 小时前
交错磁研究进展材料物性与交叉应用
数据库·人工智能·python·opencv·算法