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;
}
相关推荐
沧澜sincerely几秒前
蓝桥杯算法练习
算法·职场和发展·蓝桥杯
一起养小猫4 分钟前
Flutter for OpenHarmony 进阶:手势识别与碰撞检测算法深度解析
算法·flutter·harmonyos
Herbert_hwt5 分钟前
数据结构与算法绪论:为何学、学什么、如何避坑
c语言·数据结构·算法
XX風6 分钟前
1-3-kernel PCA
算法
今儿敲了吗9 分钟前
11| 子集
c++·笔记·算法
Jinuss13 分钟前
源码分析之React中Scheduler调度器的最小二叉堆
javascript·算法·react.js
高洁0115 分钟前
多模态融合驱动下的具身学习机制研究
python·算法·机器学习·数据挖掘·知识图谱
宵时待雨16 分钟前
数据结构(初阶)笔记归纳10:二叉树
数据结构·笔记·算法
凤年徐25 分钟前
容器适配器深度解析:从STL的stack、queue到优先队列的底层实现
开发语言·c++·算法
乐迪信息26 分钟前
乐迪信息:AI防爆摄像机的船舶船体烟火智能预警系统
大数据·网络·人工智能·算法·无人机