摘要: DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.Note: the number of first circle should always be 1.Inputn (0 < n < 20).OutputThe output format is shown 阅读全文
posted @ 2012-02-28 21:55 狸の舞 阅读(173) 评论(0) 推荐(0) 编辑
摘要: qsort各种强大啊~~写的也简单~~好喜欢它~~开心哦~~qsort及其用法函数原型void qsort(void *base, size_t num, size_t width, int (__cdecl *compare )(const void *elem1, const void *elem2 ) ); 大概的意思是,第一个参数指明了要排序的数组(比如:程序中的num),第二个参数给出了数组的大小(qsort没有足够的智力预知你传给它的数组的实际大小),第三个参数给出了数组中每个元素以字节为单位的大小。最后那个长长的家伙,给出了排序时比较元素的方式..再给一个例子:int a[n]; 阅读全文
posted @ 2012-02-28 20:13 狸の舞 阅读(217) 评论(0) 推荐(0) 编辑