当前位置:网站首页>reading order
reading order
2022-07-29 17:15:00 【seal ink】
阅读顺序
Most languages are read from left to right.但是,在一些语言中,Reading order is from right to left.This adds a lot of trouble to language communication.现在,请你编写一个程序,It can automatically convert a text written from left to right to the order from right to left.
Input
输入的第一行是一个数字n(n<100),接下来的有nline of text,由字母、空格、numbers and various punctuation marks,The length of each line of text does not exceed200个字符.
Output
Convert the entered text into right-to-left order,One line of input corresponds to one line of output.
Sample Input
3
a man a plan a canal panama
Frankly, I don’t think we’ll make much
OK?
Sample Output
amanap lanac a nalp a nam a
hcum ekam ll’ew kniht t’nod I ,ylknarF
?KO
Hint
If the spaces between words are not considered,Reading the first sentence from left to right is the same as reading right to left:-)
#include<stdio.h>
#include<string.h>
int main()
{
int N;
char a[201];
char b[201];
scanf("%d",&N);
getchar();
while(N--)
{
gets(a);
int len=strlen(a);
for(int i=0;i<len;i++)
{
b[len-1-i]=a[i];
}
for(int i=0;i<len;i++)
printf("%c",b[i]);
printf("\n");
}
return 0;
}
边栏推荐
猜你喜欢

win10 校验sha256

ByteArrayOutputStream class source code analysis

商城商品的知识图谱构建

Chicken and rabbit in the same cage

RocketQA: across batches negative sampling (cross - batch negatives), the denoising of strong negative cases of sampling (denoised hard negative from) and data to enhance (data augment

【翻译】设备管理器—英特尔网卡属性设置高级选项的功能

MUD DAO火爆入世,DAO主轮募集蓄势待发

#夏日挑战赛# HarmonyOS - 实现签名功能

Turbine聚合监控

1802. 有界数组中指定下标处的最大值【贪心 +二分】
随机推荐
环球晶圆成功以43.5亿欧元获得Siltronic控股权
string 保留小数点后两位(js中保留小数点后两位)
再见Postman!一款更适合国人的接口管理工具
RocketQA:通过跨批次负采样(cross-batch negatives)、去噪的强负例采样(denoised hard negative sampling)与数据增强(data augment
接口项目02文档:Jmeter接口测试与性能测试
LinkedList 5-141. 环形链表
[WeChat Mini Program] Component usage and attribute reference
[极客大挑战 2019]BabySQL 1
pjax无法生效解决办法,butterfly主题维护你的pjax
Texture 】 【 terrain 】 【 virtual virtual terrain texture technology is introduced
leetcode:1901. 寻找峰值 II【二分找矩阵局部最大】
Staggered question explanation
MUD DAO火爆入世,DAO主轮募集蓄势待发
【翻译】设备管理器—英特尔网卡属性设置高级选项的功能
[网络知识]路由OSPF
BUUCTF——MISC(流量分析)
特殊的类——集合与泛型(C#)
任正非:华为绝不会出售终端手机业务!
百面量化金融
【Swoole系列3.2】Swoole 异步进程服务系统