Hoj 2991 Find the Point
来源:互联网 发布:阿里云盒子怎么刷机 编辑:程序博客网 时间:2024/05/22 08:12
本题也非常简单,主要练习sscanf()使用,以及sort()排序。
题目:http://acm.hit.edu.cn/hoj/problem/view?id=2991
#include <iostream>#include <stdio.h>#include <string.h>#include <math.h>#include <algorithm>using namespace std;struct point{ char s[100]; double x; double y;};point p[102];//从小到大排序bool cmp(point a,point b){ return (a.y<b.y) || (a.x == b.x && a.y<b.y);}int main(){#ifndef ONLINE_JUDGE freopen("in.txt","r",stdin);#endif int t; int n; scanf("%d",&t); while(t--) { scanf("%d",&n); for(int i=0;i<n;i++) { scanf("%s",p[i].s); sscanf(p[i].s," (%lf,%lf)",&p[i].x,&p[i].y); } sort(p,p + n,cmp); printf("%s %s\n",p[n-1].s,p[0].s); } return 0;}
- Hoj 2991 Find the Point
- HOJ 1597 find the nth digit(贪心)
- Find the middle point of the linked list
- HOJ 2089 4th point
- Matlab实现——to find the fixed point
- 【Hackerrank】Find the merge point of two joined linked lists
- How to find the crash point: Android Native crash
- HOJ 1128 Find Them
- Find the first intersection of two lists (if the two list are merged at some point)
- HOJ The Colored Cubes
- HOJ 3074 The Position
- HOJ 2785 The Game
- Hoj 1140 The Game
- Hoj 1760 The jackpot
- hoj Counting the algorithms
- Unable to find a javac compiler;Perhaps JAVA_HOME does not point to the JDK
- Unable to find a javac compiler;Perhaps JAVA_HOME does not point to the JDK解决
- 寻找最近点对问题(FCPP find the closest pair of point)
- windows 和 linux 清理 临时 文件 的脚本
- 菜鸟:IOS 学习:磨难记 (第六天)
- 关于大脑的一些常识,学习中请注意灵活运用
- LRJ生成可重复的排列
- fckeditor零碎要点---3.<FCK:editor instanceName="myeditor" value="李德伟欢迎您" height="400"></FCK:editor
- Hoj 2991 Find the Point
- 第十二节 html5学习——web worker
- 利用awk统计Linux下最常用的20条命令的shell
- 最短路
- arm介绍
- 不能上网最常用最好用的解决办法
- fckeditor异常总结---1.NoClassDefFoundError: org/slf4j/LoggerFactory和NoClassDefFoundError: org/apache/log
- 脑力游戏
- 第十三节 html5学习——服务器发送事件