HDU 1173(技巧题)

来源:互联网 发布:python格式化毫秒数 编辑:程序博客网 时间:2024/06/05 02:47
#include <stdio.h>#include <string.h>#include <algorithm>#include <iostream>using namespace std;const int maxn = 1e6 + 5;double x[maxn], y[maxn];int main(){    int t;    while(cin>>t && t)    {        for(int i = 1; i <= t; i++)            cin>>x[i]>>y[i];        sort(x + 1, x + t + 1);        sort(y + 1, y + t + 1);        printf("%.2lf %.2lf\n", x[t / 2 + 1], y[t / 2 +1]); //寻找中位数即可    }    return 0;}

0 0
原创粉丝点击