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;
}
相关推荐
会编程的土豆几秒前
【数据结构与算法】栈的应用
数据结构·c++·算法
菜菜的顾清寒3 分钟前
力扣hot100(17) 缺失的第一个正数
算法·leetcode·职场和发展
光泽雨8 分钟前
c#数值类型之间的自动转换
java·算法·c#
ZPC82108 分钟前
moveit2 servo -movegroup aciton client arm_controller -rviz2
人工智能·算法·计算机视觉·机器人
阿Y加油吧28 分钟前
从斐波那契到动态规划:两道入门题吃透 DP 核心思想
算法·动态规划·代理模式
米啦啦.29 分钟前
多态性、虚函数
开发语言·c++·算法·多态·抽象类·纯虚函数
承渊政道37 分钟前
【递归、搜索与回溯算法】(二叉树深搜模型拆解与经典题型全面突破)
数据结构·c++·学习·算法·leetcode·macos·bfs
会编程的土豆1 小时前
常用算法里的细节
数据结构·c++·算法·图论
skilllite作者1 小时前
为什么我认为 Hermes 需要说明 self-evolution 的设计来源
人工智能·算法·rust·openclaw·agentskills
tankeven1 小时前
HJ179 小苯的IDE括号问题(easy)
c++·算法