摘要: Georg Cantor用这张数表证明了有理数是可枚举的刘汝佳教主的白书上有这道题,不过貌似解答是错误的T_T1/1 1/2 1/3 1/4 1/5 …2/1 2/2 2/3 2/4 …3/1 3/2 3/3 …4/1 4/2 …5/1 ……网上说Z字型编号。。。我怎么就不觉得是Z字型。。。明明是蛇形1-1/1; 2-1/2; 3-2/1; 4-3/1; 5-2/2; 6-1/3.....如下图输出第N项的值:样例输入:314712345样例输出:2/12/41/459/99 1 #include <stdio.h> 2 3 int main(void) 4 { 5 int n; 阅读全文
posted @ 2012-02-15 21:40 漂木 阅读(333) 评论(0) 推荐(0) 编辑
摘要: 一、对int类型数组排序int num[100];Sample:int cmp ( const void *a , const void *b ){return *(int *)a - *(int *)b;}qsort(num,100,sizeof(num[0]),cmp);二、对char类型数组排序(同int类型)char word[100];Sample:int cmp( const void *a , const void *b ){return *(char *)a - *(int *)b;}qsort(word,100,sizeof(word[0]),cmp);三、对double类型 阅读全文
posted @ 2012-02-15 17:49 漂木 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 只写了加减,乘除不太明白T_T..弄明白补上。 1 #include <stdio.h> 2 #include <string.h> 3 4 #define MAX 1000 5 6 void Add(char *str1,char *str2, char *str3); 7 void Minus(char *str1, char *str2, char *str3); 8 void Times(char *str1, char *str2, char *str3); 9 10 int main(void) 11 { 12 char str1[MAX], str... 阅读全文
posted @ 2012-02-15 16:33 漂木 阅读(192) 评论(0) 推荐(0) 编辑