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;
}
相关推荐
垫脚摸太阳几秒前
第 36 场 蓝桥·算法挑战赛·百校联赛---赛后复盘
数据结构·c++·算法
Aaswk12 分钟前
刷题笔记(回溯算法)
数据结构·c++·笔记·算法·leetcode·深度优先·剪枝
NAGNIP32 分钟前
一文搞懂CNN经典架构-ResNet!
算法·面试
计算机安禾32 分钟前
【数据结构与算法】第14篇:队列(一):循环队列(顺序存储
c语言·开发语言·数据结构·c++·算法·visual studio
Frostnova丶37 分钟前
(11)LeetCode 239. 滑动窗口最大值
数据结构·算法·leetcode
GoCoding1 小时前
YOLO-Master 与 YOLO26 开始
算法
VALENIAN瓦伦尼安教学设备1 小时前
设备对中不良的危害
数据库·嵌入式硬件·算法
不熬夜的熬润之1 小时前
APCE-平均峰值相关能量
人工智能·算法·计算机视觉
yzx9910131 小时前
实时数据流处理实战:从滑动窗口算法到Docker部署
算法·docker·容器
佩奇大王2 小时前
P674 三羊献瑞
算法·深度优先·图论