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;
}
相关推荐
im_AMBER1 天前
Leetcode 74 K 和数对的最大数目
数据结构·笔记·学习·算法·leetcode
t198751281 天前
电力系统经典节点系统潮流计算MATLAB实现
人工智能·算法·matlab
断剑zou天涯1 天前
【算法笔记】蓄水池算法
笔记·算法
长安er1 天前
LeetCode 206/92/25 链表翻转问题-“盒子-标签-纸条模型”
java·数据结构·算法·leetcode·链表·链表翻转
唯道行1 天前
计算机图形学·23 Weiler-Athenton多边形裁剪算法
算法·计算机视觉·几何学·计算机图形学·opengl
CoderYanger1 天前
动态规划算法-01背包问题:50.分割等和子集
java·算法·leetcode·动态规划·1024程序员节
花月C1 天前
个性化推荐:基于用户的协同过滤算法
开发语言·后端·算法·近邻算法
lxh01131 天前
最长递增子序列
前端·数据结构·算法
Youyzq1 天前
前端项目发布到cdn上css被编译失效问题rgba失效和rgb失效
前端·css·算法·cdn
风筝在晴天搁浅1 天前
代码随想录 516.最长回文子序列
算法