当前位置:网站首页>2022 information and future preparation 3 new online judge 1059: string sorting
2022 information and future preparation 3 new online judge 1059: string sorting
2022-04-21 10:31:00 【joe_ Zxq's programming world】
P1059 - String sort - New Online Judge
http://oj.ecustacm.cn/problem.php?id=1059
Memory limit :256 MB The time limit :1 S Standard input and output
Topic type : Traditional evaluation methods : Text comparison uploader : External import
Submit :208 adopt :81
Submit Submit the record Statistics Discussion board
Title Description
give n A string , Change the uppercase letters of each string to lowercase letters , Change lowercase letters to uppercase letters , Then output from small to large in dictionary order .
Input format
The first line is a positive integer n(n≤1000)
Next n That's ok , One string per line , Length not exceeding 10, Only upper and lower case letters .
Output format
The output, n That's ok , Output from small to large in dictionary order .
sample input Copy
3
Abc
bAx
Cx
sample output Copy
BaX
aBC
cX
Category labels
Ideas :
Water problem , Train of thought .
AC Code :
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define vll2 vector<ll,vector<ll> >
#define vi2 vector<int,vector<int> >
#define pii pair<int,int>
#define pll pair<ll,ll>
int main(){
int tc; cin>>tc;
string s[tc];
for(int i=0;i<tc;i++) cin>>s[i];
for(int i=0;i<tc;i++){
for(int j=0;j<s[i].size();j++){
if(s[i][j]<='Z'&&s[i][j]>='A') s[i][j]+='a'-'A';
else s[i][j]-='a'-'A';
}
}
sort(s,s+tc);
for(int i=0;i<tc;i++) cout<<s[i]<<endl;
return 0;
}
//ACplease!!!
/* printf(" \n");
printf(" \n");
printf(" * * * * * * * * * * * * \n");
printf(" * * * * * * * * \n");
printf(" * * * * * * * * \n");
printf(" * * * * * \n");
printf(" * * * * * \n");
printf(" * * * * * \n");
printf(" * * * * * \n");
printf(" * * * * * \n");
printf(" * * * * * \n");
printf(" * * * * * * * * * * * * * * * * * * * * * * * * \n");
*/
版权声明
本文为[joe_ Zxq's programming world]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211000368024.html
边栏推荐
- 运行npm install命令的时候会发生什么?
- 看完这篇 教你玩转渗透测试靶机vulnhub——DC9
- The prospectus of quwan group is "invalid", and its TT voice has been taken off the shelf. How to achieve stable growth?
- torch.autograd.Function 自定义
- Digital Economy & Green Innovation matching: Green Patent matching data of digital finance enterprises of 3169 companies in China, 2011-2019
- WinPcap获取设备列表
- WXML模板语法-数据绑定
- Why programming is so difficult: starting from the deduction of stored value card
- “空气洗”再迎迭代,模仿者又有了新目标
- C#入门-利用正则表达式校验身份证号
猜你喜欢

(SIP-1-话机注册)关于IP话机通过SIP协议注册到PBX电话交换机的全过程解析-如何看wireshark中的报文

看完这篇 教你玩转渗透测试靶机vulnhub——DC9

Nanny level tutorial on building personal home page (I)

2022信息与未来预备刷题3《New Online Judge 1059: 字符串排序》

How to read a source code?

数字经济-新经济指数(2017-2022)&31省数字经济测算(2013-2020)两大维度指标

Read the meaning of seek tiger's launch of Genesis node

再战leetcode (392.判断子序列)

DNS域名系统-因特网的目录服务

MKL与VS2019配置方法
随机推荐
微信公众号网页分享设置及问题
"Air washing" meets the iteration again, and the imitator has a new goal
24张图攻克border-image
6_数据分析—建模
24张图攻克border-image
SQL: SQL file of tree three-tier occupational classification table
Exit status code in Bash shell
Digital Economy & Green Innovation matching: Green Patent matching data of digital finance enterprises of 3169 companies in China, 2011-2019
【并发编程045】什么是伪共享内存顺序冲突?如何避免?
What happens when you run the NPM install command?
Release announcement of HMS core version 6.4.0
Usage of SAP ABAP for all entries
二分查找符合要求的值及局部最小值
openCV——模板匹配
背包问题小结(0-1,完全,多重背包问题)
IDEA和PyCharm启动时进入欢迎界面
我的创作纪念日
内存模型和名称空间知识点总结
ant a-table 树表格级联选择
SQL:树形三层职业分类表的SQL文件