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;
}
相关推荐
橘颂TA8 分钟前
【Linux】从 “抢资源” 到 “优雅控场”:Linux 互斥锁的原理与 C++ RAII 封装实战(Ⅰ)
linux·运维·服务器·c++·算法
YGGP23 分钟前
【Golang】LeetCode 19. 删除链表的倒数第 N 个节点
算法·leetcode·链表
池塘的蜗牛30 分钟前
mmse-based-OFDM-signal-processing(2)
算法
Kris_LinSD39 分钟前
算法小实验——分治算法快速排序问题实验(含报告)
c语言·算法
Super小白&40 分钟前
十大经典排序算法详解(附C语言实现+复杂度分析)
c语言·算法·排序算法
Eloudy40 分钟前
Birkhoff 多胞形,双随机矩阵的几何世界
算法
2503_946971861 小时前
【SystemDesign/HA】2025年度高可用分布式仿真节点与预测模型容灾演练配置 (Disaster Recovery Config)
大数据·分布式·算法·系统架构·数据集
GrowingYi1 小时前
算法基础技术栈
数据结构·算法
炽烈小老头1 小时前
【 每天学习一点算法 2026/01/04】打家劫舍
学习·算法
leiming61 小时前
c++ for_each算法
开发语言·c++·算法