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;
}
相关推荐
tlsnzcel19 分钟前
【java】常见限流算法原理及应用
java·算法
weixin_5150339343 分钟前
ccfcsp-202006(4、5)
c++·算法
西柚与蓝莓43 分钟前
922. 按奇偶排序数组 II 双指针 力扣
数据结构·算法·leetcode
宇柔1 小时前
Day5:移除链表元素
数据结构·算法·链表
Amor风信子1 小时前
【力扣】2376. 统计特殊整数
算法·leetcode·职场和发展
极客小张1 小时前
基于正点原子Linux开发板的智能监控与家电控制系统设计:深度解析Video4Linux和TCP/IP技术栈
linux·运维·c++·物联网·网络协议·tcp/ip·算法
JustCouvrir2 小时前
代码随想录算法训练营Day5
算法
周哈里窗的编程3 小时前
CSP-CCF★201912-2回收站选址★
c++·算法·图论
SpongeG4 小时前
数据结构第三周做题总结_链表
数据结构·算法·链表
everyStudy4 小时前
前端五种排序
前端·算法·排序算法