摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1173求出x,y的中位数,即为答案,代码中运用快排View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 double x[1000000],y[1000000]; 4 int cmp(const void*a,const void*b) 5 { 6 return *(double *)a>*(double *)b?1:-1; 7 }//快排 8 int main() 9 {10 int n,i;11 while(scanf(&q 阅读全文
posted @ 2013-03-19 19:50 执着追求的IT小小鸟 阅读(138) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=24&problem=1268&mosmsg=Submission+received+with+ID+11407977输入一组数据,求出在排序中数据交换的次数View Code #include<stdio.h>int main(){ int a[1010],i,j,sum,n,temp; while(scanf("%d",& 阅读全文
posted @ 2013-03-09 11:25 执着追求的IT小小鸟 阅读(120) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=24&problem=982&mosmsg=Submission+received+with+ID+11407931vito 在一条街选间房子,使得到亲戚家的距离之和最小,求出这个和,即在数组中求出中位数,计算各个数与中位数的差之和View Code #include<stdio.h>#include<math.h>int main(){ i 阅读全文
posted @ 2013-03-09 11:08 执着追求的IT小小鸟 阅读(110) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=24&problem=2113&mosmsg=Submission+received+with+ID+11407808简单的比较两个数的大小,记得类型定得大一点View Code #include<stdio.h>#include<string.h>int main(){ long long a,b; int i; while(scanf(& 阅读全文
posted @ 2013-03-09 10:23 执着追求的IT小小鸟 阅读(118) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=24&problem=1311&mosmsg=Submission+received+with+ID+11405247给出几组数据,算出这些数据中高过平均数的个数所占的百分比,保留三位小数View Code #include<stdio.h>int main(){ int i,c; double x[1010],sum,avr,n,ans; scanf( 阅读全文
posted @ 2013-03-08 21:40 执着追求的IT小小鸟 阅读(116) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=24&problem=1753&mosmsg=Submission+received+with+ID+11404818给出俩个胜利者的分数的和与差,求出这两个分数,用二元一次方程组可以求出答案。注意:根据实际:分数是整数,且不为负View Code #include<stdio.h>int main(){ long long s,d,n; scanf(& 阅读全文
posted @ 2013-03-08 20:01 执着追求的IT小小鸟 阅读(111) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=2307把一个长长的数各个位上的数相加,如果得到的结果大于9,则重复此步骤。只要用字符串接收这个数字,则可以超额完成任务View Code 1 #include<stdio.h> 2 #include<string.h> 3 char str[50]; 4 void pro(int n) 5 { 6 int i=0; 7 whi 阅读全文
posted @ 2013-03-08 19:58 执着追求的IT小小鸟 阅读(174) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=24&problem=429&mosmsg=Submission+received+with+ID+11314444按题意给出的数据输出一定频率的波浪线,注意每个输出后都有空行,excluding last one。View Code 1 #include<stdio.h> 2 int main() 3 { 4 int h,f,i,j,k,n; 5 sc 阅读全文
posted @ 2013-02-20 15:26 执着追求的IT小小鸟 阅读(120) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=24&problem=520&mosmsg=Submission+received+with+ID+11314375输入“小时:分钟”,求出该时刻的时针跟分针夹角,我先求出时针绕过的角度,再求分针绕过的角度,二者的差值就是结果View Code 1 #include<stdio.h> 2 #include<math.h> 3 int main 阅读全文
posted @ 2013-02-20 15:05 执着追求的IT小小鸟 阅读(76) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=24&problem=484&mosmsg=Submission+received+with+ID+11313357任何大于4的偶数都能写成sum of two odd prime number ,只要从小开始逐一判断,然后写出最大和最小的组合就可以了View Code 1 #include<stdio.h> 2 #include<math.h&g 阅读全文
posted @ 2013-02-20 10:58 执着追求的IT小小鸟 阅读(123) 评论(0) 推荐(0) 编辑