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;
}
相关推荐
明月_清风17 分钟前
十大经典排序算法 Go 实现全解:从入门到面试通关
后端·算法·排序算法
liliangcsdn32 分钟前
如何对IC时间序列进行汇总统计分析示例
人工智能·算法·机器学习
土司大王42 分钟前
LeetCode hot100——缺失的第一个正数
数据结构·算法·leetcode
Cccp.1231 小时前
【leetcode】(二)认识O(NlogN)的排序
算法·leetcode
明月_清风1 小时前
算法时间复杂度:给小白的一堂"算快慢"课
后端·算法
vivo互联网技术1 小时前
TinySR:面向真实世界图像超分辨率的轻量级扩散模型
人工智能·算法
不会就选b2 小时前
数据结构之栈的算法题(OJ)
linux·数据结构·算法
人工智能培训2 小时前
人工智能性别与地域偏见的成因及消解路径
大数据·人工智能·算法·生活
鹿角片ljp2 小时前
LeetCode 56:合并区间复盘|从排序思维到 List<int[]> 的简洁写法
算法·leetcode·list
M78佐菲2 小时前
Linux学习笔记:网络通信
linux·笔记·学习·算法