当前位置:网站首页>ASCII code sorting
ASCII code sorting
2022-07-29 17:15:00 【seal ink】
ASCII码排序
时间限制: 3 Sec 内存限制: 64 MB
题目描述
输入三个字符(可以重复)后,按各字符的ASCII码从小到大的顺序输出这三个字符.
输入
第一行输入一个数N,表示有N组测试数据.后面的N行输入多组数据,每组输入数据都是占一行,有三个字符组成,之间无空格.
输出
对于每组输入数据,输出一行,字符中间用一个空格分开.
样例输入
2
qwe
asd
样例输出
e q w
a d s
#include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
getchar();
while(n--)
{
char a,b,c,t;
scanf("%c%c%c",&a,&b,&c);
getchar();
if(a>b)
{
t=a;
a=b;
b=t;
}
if(b>c)
{
t=b;
b=c;
c=t;
}
if(a>b)
{
t=a;
a=b;
b=t;
}
printf("%c %c %c\n",a,b,c);
}
return 0;
}
边栏推荐
猜你喜欢
Twin all things digital visual | join the real world and the digital space
This article penetrates the architecture design and cluster construction of the distributed storage system Ceph (hands-on)
Query term weights, search term weighting
传输层 TCP的连接管理-释放连接四次握手
HMS Core音频编辑服务音源分离与空间音频渲染,助力快速进入3D音频的世界
GBJ2510-ASEMI电机专用25A整流桥GBJ2510
MQTT over QUIC:下一代物联网标准协议为消息传输场景注入新动力
How should small and medium-sized financial enterprises carry out disaster recovery construction?
线程中的常见方法
HMS Core音频编辑服务音源分离与空间音频渲染,助力快速进入3D音频的世界
随机推荐
leetcode:1901. 寻找峰值 II【二分找矩阵局部最大】
1802. 有界数组中指定下标处的最大值【贪心 +二分】
[极客大挑战 2019]LoveSQL 1
接口内容01文档:postman学习路线
虚拟偶像的歌声原来是这样生成的!
Sentinel热门词汇限流如何实现
稳步向前不忘初心,沃尔沃的安全感来自公众的认可
地平线获得舜宇集团战略投资并与舜宇智领签署战略合作协议
MLX90640 infrared thermal imager development notes (9)
[网络知识]路由OSPF
【Swoole系列3.2】Swoole 异步进程服务系统
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
分布式前修课:MySQL实现分布式锁
Groeb - "gramm, explicit and complete n -" gramm mask language model, implements the explicit n - "gramm semantic unit modeling knowledge.
支持百亿请求的微博广告运维技术实践
澜舟孟子轻量化预训练模型技术实践
应用程序间的数据传输TCP协议的特点及
微信公众号借助小程序云函数实现支付功能
mysql的sql分页查询语句怎么写_sql 分页查询语句(mysql分页语句)「建议收藏」
【高并发】我用多线程进一步优化了亿级流量电商业务下的海量数据校对系统,性能再次提升了200%!!(全程干货,建议收藏)