2012年3月22日

HDUOJ 2056 Rectangles (几何计算问题)

摘要: RectanglesTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7889Accepted Submission(s): 2538Problem DescriptionGiven two rectangles and the coordinates of two points on the diagonals of each rectangle,you have to calculate the area of the intersected 阅读全文

posted @ 2012-03-22 16:10 铁树银花 阅读(264) 评论(0) 推荐(0) 编辑

快排函数的使用语法

摘要: 以对整型数组排序为例:头文件#include<stdlib.h>函数体intcmp(const void *a, const void *b){return(*(int *)a-*(int *)b);主函数void main(){ .int s[100];qsort(s,n,sizeof(s[0]),cmp);}PS:1、如果排序的是字符型数组则在函数体内return(*(int *)a-*(int *)b); 改成return(*(char *)a-*(char*)b);其他类型同理2、要对其从s[i]开始的m个元素进行排序,只需要在第一个和第二个参数上进行一些修改:qsort( 阅读全文

posted @ 2012-03-22 15:15 铁树银花 阅读(416) 评论(0) 推荐(0) 编辑

导航