Title Link: https://vjudge.net/problem/HDU-1785
Angle into tan x=k, increment in the first quadrant, so transform the problem just fine.
1#include <iostream>2#include <queue>3#include <stack>4#include <map>5#include <Set>6#include <bitset>7#include <cstdio>8#include <algorithm>9#include <cstring>Ten#include <climits> One#include <cstdlib> A#include <cmath> -#include <time.h> - the using namespacestd; - - - intMain () + { - intn,i,j; + floats,a[101],b[101],c[101]; A while(SCANF ("%d", &n) &&n>=0) at { - for(i=0; i<n;i++) - { -scanf"%f%f",&a[i],&b[i]); -c[i]=a[i]/B[i]; - } in for(i=0; i<n-1; i++) - { to for(j=i+1; j<n;j++) + { - if(c[j]>C[i]) the { *s=a[j];a[j]=a[i];a[i]=s; $s=b[j];b[j]=b[i];b[i]=s;Panax Notoginsengs=c[j];c[j]=c[i];c[i]=s; - } the } + } A if(n>0) theprintf"%.1f%.1f", a[0],b[0]); + for(i=1; i<n;i++) - { $printf"%.1f%.1f", A[i],b[i]); $ } -printf"\ n"); - } the return 0; -}
(HDU) 1785--All excellent (your talent)