摘要: #include <stdio.h>#include <math.h>void clearYinziArr(int arr[]);int aItem(int key, int i);int main() { //求PI //pi=4*(1-1/3+1/5-1/7+1/9-1/11....) //本次求PI 直到某一项绝对值小于 10^(-6) int sign = 1;//控制正 负 double fenmu = 1; double sum = 0; while (fabs(1 / fenmu) > 1e-6) { //fabs是math.h中的函数... 阅读全文
posted @ 2013-03-25 22:33 cart55free99 阅读(302) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#define N 30int out(int str[], int start, int counts);int main() { int str[30]; int i = 0; for (; i < 30; i++) { str[i] = i + 1; } // printf("%d,\n", out(str, 0, 9));//10 //ok int rest = 30; int start = 0; while (rest > 15) { start = out(str... 阅读全文
posted @ 2013-03-25 20:30 cart55free99 阅读(163) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <stdlib.h>#include <string.h>void myCount(char *filename);void maxLine(char *filename);int main(){ char *filename="D:/23.txt"; myCount(filename); maxLine(filename); return 1;}void myCount(char * filename){ FILE * fp; fp=fopen(filename,"r&qu 阅读全文
posted @ 2013-03-25 16:51 cart55free99 阅读(181) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>int binSearch(int arr[], int low, int high, int key);int binSearch2(int arr[], int low, int high, int key);int binSearch3(int arr[],int start,int ends,int key);int main() { int arr[]={3,8,11,15,17,22,23,26,28,29,34}; //printf("%d",binSearch(arr,0,10,26)); printf(&qu 阅读全文
posted @ 2013-03-25 11:18 cart55free99 阅读(153) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#define N 4int maxInL(int arr[4][4], int line);int minInC(int arr[4][4], int col);int main() { // int arr[4][4]={ // {15,23,34,18}, // {19,20,16,9}, // {14,7,6,5}, // {10,4,3,1} // }; int arr[4][4] = { { 67, 68... 阅读全文
posted @ 2013-03-25 10:28 cart55free99 阅读(184) 评论(0) 推荐(0) 编辑