当前位置:网站首页>Process comma separated strings and sort the output in ascending dictionary order
Process comma separated strings and sort the output in ascending dictionary order
2022-04-23 00:22:00 【I'll go to bed again】
//
#include<bits/stdc++.h>
using namespace std;
int main()
{
int i;
vector<string> v;
string s,ts;
while( getline( cin,s ) )
{
ts.clear(); v.clear();
for( i=0;i<s.size();i++ )
{
if( s[i]!=',' ) ts+=s[i];
else v.push_back(ts),ts.clear();
}
v.push_back(ts);
sort( v.begin(),v.end() );
for( i=0;i<v.size();i++ )
{
cout<<v[i]<<endl;
}
}
return 0;
}
版权声明
本文为[I'll go to bed again]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204222153581831.html
边栏推荐
- Absolute positioning does not use left, right, top, bottom and other attributes
- sideEffects导致的全局样式消失
- (转)Matlab R2014a 64位与Visual Studio2015的mex相关问题
- Nodejs+express登录鉴权并注册部分
- Calculation of Beifu scaling factor
- Detailed explanation of kubernetes (VIII) -- resource allocation list of kubernetes
- Array de duplication - basic data type
- Application of tidb in massive transactions and real-time analysis of fast food chain enterprises
- 99 multiplication table code
- ArcGIS 计算地块容积率
猜你喜欢

MySQL安装及基本使用教程

倍福TwinCAT两台CX控制器之间做ADS通信

Misunderstanding of indexlookup

Installation and use of scvi tutorial

How can domestic engine cocos break through the jungle?

Communication error between Willem touch screen and Beifu PLC adsparsesymbol invalid array index

Componentwillunmount uninstall components

(transfer) remote access to window remote desktop win10 through external network

一场由TiCDC异常引发的GC不干活导致的Tikv硬盘使用问题

(转)Matlab R2014a 64位与Visual Studio2015的mex相关问题
随机推荐
Solution for error reporting of biff el6631 and Siemens communication PROFINET
JS - process and split the data of consecutive months
Utiliser dottrace 6. 0 performance, analyse de mémoire
Analytic hierarchy process software operation steps (Yaahp)
Dialogue with Yang jiongwei, fast is reflected in seizing the "bonus". In fact, tob company should run slower
(transfer) how winscp (SSH FTP client) generates the key to log in Linu
The global style caused by sideeffects disappears
Pain points solved by tidb under the wave of localization
OJ daily practice -- iterative method for finding square root
ArcGIS 制作3D规划图纸
【图像分类】 一文读懂AlexNet
倍福两台CX控制器之间添加路由
(转)Aspose.words介绍
Detailed introduction of Mitsubishi mr-je-c servo application
将 AWS S3 数据迁移至 TiDB Cloud 集群
(transfer) matlab r2014a 64 bit and mex related problems of visual studio 2015
Configuration parameters of common product module models of Beifu
(转)Excel 2016 内存或磁盘空间不足无法打开Excel
Nodejs学习笔记
EXCEL IF函数的简单使用