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相关推荐

  1. 巴卡斯杯 中国大学生程序设计竞赛 - 女生专场(重现)解题思路

    此文章可以使用目录功能哟↑(点击上方[+]) 经过这么一次女生赛,告诉我们千万不要小瞧女生,不然会死得很惨,orz... 链接→"巴卡斯杯" 中国大学生程序设计竞赛 - 女生专场( ...

  2. 2021暑期积分赛一

    2021暑期积分赛一 A - Constructing the Array (CF353D) B - Taxi (CF158B) C - Running Median HDU - 3282 D - W ...

  3. 一阶线性常微分方程解法总结 Summary of Solving First Order Linear Ordinary Differential Equation (ODE)

    文章目录 1. Separable Differentiable Equations 2. Linear Equations First-order linear equation Solution ...

  4. 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 ...

  5. 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 ...

  6. POJ 3265 Problem Solving 动态规划

    Problem Solving Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 1914   Accepted: 747 De ...

  7. 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 ...

  8. 102. Binary Tree Level Order Traversal

    题目 Binary Tree Level Order Traversal 层次遍历二叉树 链接 Given a binary tree, return the level order traversa ...

  9. Mysql分页order by数据错乱重复

    公司用的是Mybatis,发现分页和排序时直接传递参数占位符用的都是 ,由于,由于,由于有SQL注入风险,要改为#,但是封装page类又麻烦,所以直接使用了 pageHelper 插件了,方便快捷,但 ...

最新文章

  1. CentOS 5.4下的Memcache安装步骤(Linux+Nginx+PHP+Memcached)
  2. 如何保护你的linux操作系统
  3. 手工sql注入常规总结
  4. MySQL 中锁的面试题总结
  5. Linux版APP超级签名分发系统源码
  6. do case php,PHP 规范之编程规范
  7. Spring : Spring Aop之ProxyFactory
  8. 2019牛客暑期多校训练营(第二场)A(随机化)
  9. tomcat、netty以及nodejs的helloworld性能对比
  10. Python unittest discover()方法与执行顺序补充
  11. wp 一次简单的攻防训练
  12. php单页搜索引擎小偷,PIGO mini php搜索小偷 v2.0 正式版
  13. 服务器被入侵了怎么办
  14. on1 photo raw 2020中文版(RAW图像处理) v14.5.1.9231绿色便携版
  15. 永久挂载光盘镜像及本地yum源搭建
  16. [iPad]手势及分页
  17. 关于三星S9+ NFC绑定门禁卡
  18. usb设备复合g_webcam摄像头码流传输功能以及g_serial串口功能
  19. 百度人脸产品套件————壁虎 1.开箱体验
  20. 自学计算机编程应该看些什么书

热门文章

  1. 普通人学python有意义吗-为什么那么多自学Python的后来都放弃了,总结起来就这些原因...
  2. python兼职程序员工资-Python 程序员的工资能有多高?
  3. python能做什么工作-学完Python我们可以做什么工作?
  4. python入门代码大全-python入门代码指南教程书籍推荐2020总结全集汇总
  5. python新手小项目实例-有没有简单一点的 Python 小例子或小项目?
  6. Python实时语音识别控制
  7. 谷歌发布机器学习云平台 开放语音识别API
  8. 在线教育行业APP高效开发解决方案
  9. vue elementui表单清空前一次的数据
  10. Hbuilder 屏幕放大缩小