当前位置:网站首页>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;
}边栏推荐
猜你喜欢

鸡兔同笼

Review | Tech Talk activities based on Amazon KVS create intelligent visual products

【Translation】Device Manager—Intel NIC Properties Setting Advanced Options Function

再见Postman!一款更适合国人的接口管理工具

浅聊对比学习(Contrastive Learning)

Google Play 政策更新 | 2022 年 7 月

生产者消费代码

Dry goods!How to Construct SRv6-TE Performance Test Environment Using Instrumentation

Rust P2P网络应用实战-1 P2P网络核心概念及Ping程序

澜舟孟子轻量化预训练模型技术实践
随机推荐
干货!如何使用仪表构造SRv6-TE性能测试环境
Tech Talk 活动回顾|基于 Amazon KVS 打造智能视觉产品
1802. 有界数组中指定下标处的最大值【贪心 +二分】
微信公众号借助小程序云函数实现支付功能
【Swoole系列3.2】Swoole 异步进程服务系统
浅聊对比学习(Contrastive Learning)
MySQL外键约束怎么创建
新建和编辑共用一个表单,编辑之后新建,form表单resetFields失效
木棒
【微信小程序】组件使用及属性参考
This article penetrates the architecture design and cluster construction of the distributed storage system Ceph (hands-on)
数据库项目01文档:软件测试需要的数据库技能
Dynamic planning to climb the stairs
动态规划 爬楼梯
LinkedList 5-141. The circular linked list
pjax无法生效解决办法,butterfly主题维护你的pjax
Tutorial/detailed_workflow. Ipynb quantitative financial Qlib library
可行性研究报告模板
Dry goods!How to Construct SRv6-TE Performance Test Environment Using Instrumentation
阶乘因式分解