摘要: #include<stdio.h>#include<string.h>#include <malloc.h>void q_sortB(char str[20][20], int n);void qs(char str[20][20],int n);void main() { int i, n; char str[20][20] = { { "Adam" }, { "Bob" }, { "Dimen" }, { "Colin" }, { "Correal" }, 阅读全文
posted @ 2013-03-24 21:29 cart55free99 阅读(220) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <string.h>#define stuSize 1 // define的时候 没有数据类型 也不用写; 符号!!!void cpyFile(FILE *scource, FILE *dest);void writeFile(char *str); //将控制台的文字写入文件void getInfo();void saveToDisk(char path[32]);void checkFile(char path[32]);void main() { //将输入的信息写入文件 writeFile("D:/ 阅读全文
posted @ 2013-03-24 16:06 cart55free99 阅读(171) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<string.h>#include <malloc.h>void f1(char s[], int n);void f2(char *s);void f3(char s[20][20]); //这里的大小要和实参中数组大小匹配 否则可能不会得到理想值void f4(char **str);void f5(char * str[]);void main() { int i, n; char str[20][20] = { { "Adam" }, { "Bob" }, { 阅读全文
posted @ 2013-03-24 13:19 cart55free99 阅读(169) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <string.h>main() { char * str = "abcdefgh"; char *pattern = "ku"; char substr[100];//char型数据如果没有赋初值 默认值是0 不论是否是函数内还是全局变量 //char数组也是如此 默认元素都是0 //int数组和int一样 如果是在函数外定义的(也就是全局变量) 不初始化会有默认值0 //但是int 以及 int数组 在函数中定义 是没有默认值的 它会是一个随机值s int arr[100] 阅读全文
posted @ 2013-03-22 19:18 cart55free99 阅读(337) 评论(0) 推荐(0) 编辑
摘要: 头文件:include<stdio.h>定义函数:har * fgets(char * s, int size, FILE * stream);函数说明:fgets()用来从参数stream 所指的文件内读入字符并存到参数s 所指的内存空间, 直到出现换行字符、读到文件尾或是已读了size-1 个字符为止, 最后会加上NULL 作为字符串结束.返回值:gets()若成功则返回s 指针, 返回NULL 则表示有错误发生.头文件:#include <stdio.h>定义函数:int fputs(const char * s, FILE * stream);函数说明:fput 阅读全文
posted @ 2013-03-22 16:39 cart55free99 阅读(193) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <stdlib.h>#include <string.h>//void initEdge(int a[][], int n);//这样会报错 //C语言中 只有第一维可以不指定大小 其它每一维都要指定void initEdge(int a[][10], int n);//okvoid printArr(int a[10][10], int n);void initOthers(int a[10][10], int n);//输出杨辉三角//不要求对齐// 1// 1 1// 1 2 1// 1... 阅读全文
posted @ 2013-03-21 20:46 cart55free99 阅读(197) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <stdlib.h>void waqu(int num[], int wa);int main() { int num[100]; int i = 0; for (i = 0; i < 100; i++) { num[i] = i + 1; } //初始化 //挖掉1 num[0] = 0; int wa = 2; for (wa = 2; wa <= 10; wa++) { int j = 2; int isWa = 1; //挖去因子 ... 阅读全文
posted @ 2013-03-21 17:04 cart55free99 阅读(175) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <stdlib.h>#include <string.h>//Fibonacci非递归int fibonnaci1(int n);//求某一项的值int fibonnaci2(int n);//求某一项的值long sumFi(int n);//求前n项的和//递归法求前n项和 实际上是将结果都放在一个数组中 然后对该数组求和int arr[20]={0,0,0,0,0};long putToArrayFi2(int n);long sumFi2(int n);double fenmu[21];doubl 阅读全文
posted @ 2013-03-21 13:17 cart55free99 阅读(204) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <stdlib.h>#define N 9int normal(int i,int j,int mySize);int isLine1Only(int i,int j,int mySize);int isColNOnly(int i,int j,int mySize);int isLine1ColN(int i,int j,int mySize);int hasNumbers(int i,int j,int mySize);void makeCube(int n);void printCube(int mySize) 阅读全文
posted @ 2013-03-20 23:08 cart55free99 阅读(173) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <stdlib.h>void printT(char pred[],int pre_start,int pre_end,char inod[],int in_start,int in_end);int main(){ //char pred[]="ABDECFG"; //char inod[]="DBEACGF"; //printT(pred,0,6,inod,0,6); //char pred[]="ABCDEF"; //char inod[]=" 阅读全文
posted @ 2013-03-19 22:42 cart55free99 阅读(256) 评论(0) 推荐(0) 编辑