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;
}
相关推荐
君义_noip34 分钟前
信息学奥赛一本通 1607:【 例 2】任务安排 2 | 洛谷 P10979 任务安排 2
算法·动态规划·信息学奥赛·斜率优化
因兹菜1 小时前
[LeetCode]day4 977.有序数组的平方
数据结构·算法·leetcode
weixin_537590451 小时前
《C程序设计》第六章练习答案
c语言·c++·算法
码农小苏241 小时前
K个不同子数组的数目--滑动窗口--字节--亚马逊
java·数据结构·算法
独自破碎E2 小时前
【4】阿里面试题整理
java·开发语言·算法·排序算法·动态规划
涛ing7 小时前
32. C 语言 安全函数( _s 尾缀)
linux·c语言·c++·vscode·算法·安全·vim
独正己身8 小时前
代码随想录day4
数据结构·c++·算法
利刃大大11 小时前
【回溯+剪枝】找出所有子集的异或总和再求和 && 全排列Ⅱ
c++·算法·深度优先·剪枝
Rachela_z11 小时前
代码随想录算法训练营第十四天| 二叉树2
数据结构·算法
细嗅蔷薇@11 小时前
迪杰斯特拉(Dijkstra)算法
数据结构·算法