solving order
solving order
题意:按字符串后的数值由大到小输出,不能有多余空格。
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
struct node
{string s;int num;
};
node no[20];
bool cmp(node a,node b)
{return a.num>b.num;
}
int main()
{int t,i,n,a;string ss;scanf("%d",&t);while(t--){scanf("%d",&n);for(i=0;i<n;i++){cin>>ss;scanf("%d",&a);no[i].s=ss;no[i].num=a;}sort(no,no+n,cmp);for(i=0;i<n-1;i++)cout<<no[i].s<<" ";cout<<no[n-1].s<<endl;}
}
//人一我百,人十我万,怀着自信的心,永不放弃
//时间
solving order相关推荐
- 巴卡斯杯 中国大学生程序设计竞赛 - 女生专场(重现)解题思路
此文章可以使用目录功能哟↑(点击上方[+]) 经过这么一次女生赛,告诉我们千万不要小瞧女生,不然会死得很惨,orz... 链接→"巴卡斯杯" 中国大学生程序设计竞赛 - 女生专场( ...
- 2021暑期积分赛一
2021暑期积分赛一 A - Constructing the Array (CF353D) B - Taxi (CF158B) C - Running Median HDU - 3282 D - W ...
- 一阶线性常微分方程解法总结 Summary of Solving First Order Linear Ordinary Differential Equation (ODE)
文章目录 1. Separable Differentiable Equations 2. Linear Equations First-order linear equation Solution ...
- Paper:《How far are we from solving the 2D 3D Face Alignment problem? 》解读与翻译
Paper:<How far are we from solving the 2D & 3D Face Alignment problem? >解读与翻译 目录 How far a ...
- Educational Codeforces Round 25 C. Multi-judge Solving
题目链接:http://codeforces.com/contest/825/problem/C C. Multi-judge Solving time limit per test 1 second ...
- POJ 3265 Problem Solving 动态规划
Problem Solving Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 1914 Accepted: 747 De ...
- 107. Binary Tree Level Order Traversal II
题目 Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from l ...
- 102. Binary Tree Level Order Traversal
题目 Binary Tree Level Order Traversal 层次遍历二叉树 链接 Given a binary tree, return the level order traversa ...
- Mysql分页order by数据错乱重复
公司用的是Mybatis,发现分页和排序时直接传递参数占位符用的都是 ,由于,由于,由于有SQL注入风险,要改为#,但是封装page类又麻烦,所以直接使用了 pageHelper 插件了,方便快捷,但 ...
最新文章
- CentOS 5.4下的Memcache安装步骤(Linux+Nginx+PHP+Memcached)
- 如何保护你的linux操作系统
- 手工sql注入常规总结
- MySQL 中锁的面试题总结
- Linux版APP超级签名分发系统源码
- do case php,PHP 规范之编程规范
- Spring : Spring Aop之ProxyFactory
- 2019牛客暑期多校训练营(第二场)A(随机化)
- tomcat、netty以及nodejs的helloworld性能对比
- Python unittest discover()方法与执行顺序补充
- wp 一次简单的攻防训练
- php单页搜索引擎小偷,PIGO mini php搜索小偷 v2.0 正式版
- 服务器被入侵了怎么办
- on1 photo raw 2020中文版(RAW图像处理) v14.5.1.9231绿色便携版
- 永久挂载光盘镜像及本地yum源搭建
- [iPad]手势及分页
- 关于三星S9+ NFC绑定门禁卡
- usb设备复合g_webcam摄像头码流传输功能以及g_serial串口功能
- 百度人脸产品套件————壁虎 1.开箱体验
- 自学计算机编程应该看些什么书
热门文章
- 普通人学python有意义吗-为什么那么多自学Python的后来都放弃了,总结起来就这些原因...
- python兼职程序员工资-Python 程序员的工资能有多高?
- python能做什么工作-学完Python我们可以做什么工作?
- python入门代码大全-python入门代码指南教程书籍推荐2020总结全集汇总
- python新手小项目实例-有没有简单一点的 Python 小例子或小项目?
- Python实时语音识别控制
- 谷歌发布机器学习云平台 开放语音识别API
- 在线教育行业APP高效开发解决方案
- vue elementui表单清空前一次的数据
- Hbuilder 屏幕放大缩小