摘要: #include #define MAXLINE 1000int getline(char line[], int max);int strindex(char source[], char searchfor[]);char pattern[] = "ould";main(){ char line[MAXLINE]; int found = 0; while (getline(line, MAXLINE) > 0) if (strindex(line, pattern) >= 0) { printf("%s", line);... 阅读全文
posted @ 2013-11-06 21:08 欧小弟 阅读(147) 评论(0) 推荐(0) 编辑
摘要: static char daytab[2][13] = { {0,31,28,31,30,31,30,31,31,30,31,30,31}, {0,31,29,31,30,31,30,31,31,30,31,30,31}};/* 将某日某月的日期表示形式转换为某年中第几天的表示形式*/int day_of_year(int year, int month, int day){ int i, leap; leap = year%4 == 0 && year%100 != 0 || year%400 == 0; for (i = 1; i daytab[leap][... 阅读全文
posted @ 2013-11-06 16:19 欧小弟 阅读(179) 评论(0) 推荐(0) 编辑
摘要: void qsort(int v[], int left, int right){ int i, last; void swap(int v[], int i, int j); if (left >= right) return; swap(v, left, (left + right) / 2); /*将划分元素移到*/ last = left; /*v[0]处*/ for (i = left + 1; i <= right; i++) if (v[i] < v[left]) s... 阅读全文
posted @ 2013-11-04 11:18 欧小弟 阅读(185) 评论(0) 推荐(0) 编辑
摘要: # include# define NONBLANK 'a'/*replace string of blanks with a single blank*/main (){ int c,lastc; lastc = NONBLANK; while((c = getchar())!=EOF) { if (c != ' ') putchar(c); if (c == ' ') if (lastc != ' ') putchar(c); lastc = c; }} 阅读全文
posted @ 2013-10-17 20:07 欧小弟 阅读(170) 评论(0) 推荐(0) 编辑
摘要: # include/* 将输入复制到输出*/main(){ int c; while((c = getchar())!=EOF) putchar(c);} 阅读全文
posted @ 2013-10-17 19:51 欧小弟 阅读(110) 评论(0) 推荐(0) 编辑
摘要: # include/* 统计输入的字符数*/main(){ double nc; for (nc = 0;getchar()!=EOF;++nc) ; printf("%.0f\n",nc);} 阅读全文
posted @ 2013-10-17 19:50 欧小弟 阅读(159) 评论(0) 推荐(0) 编辑
摘要: /*数组表示*/void strcpy(char *s, char *t){ int i; i=0; while ((s[i]=t[i])!='\0') { s++; t++; }}/*指针1*/void strcpy(char *s, char *t){ while((*s=*t)!='\0') { s++; t++; }}/*指针2*/vo... 阅读全文
posted @ 2013-06-21 09:53 欧小弟 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 对于一个给定的数组,从中选择一个元素(叫作分区元素),并把其余元素划分成两个子集合--一个是由所有小于分区元素的元素组成的子集合,另一个是由所有大于等于分区元素的元素组成的子集合。对这样两个自己和递归应用同一过程。当某个子集合中的元素数小于两个时,这个子集合不需要再排序,故递归停止。/*qsort: 以递增顺序对v[left],,,v[right]进行排序*/void qsort(int v[],int left,int right){ int i,last; void swap(int v[],int i,int j); ... 阅读全文
posted @ 2013-06-14 11:00 欧小弟 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 转自 http://www.cnblogs.com/heaad/archive/2011/03/07/1976443.html神经网络实现1.数据预处理 在训练神经网络前一般需要对数据进行预处理,一种重要的预处理手段是归一化处理。下面简要介绍归一化处理的原理与方法。(1)什么是归一化?数据归一化,就是将数据映射到[0,1]或[-1,1]区间或更小的区间,比如(0.1,0.9) 。(2)为什么要归一化处理?<1>输入数据的单位不一样,有些数据的范围可能特别大,导致的结果是神经网络收敛慢、训练时间长。<2>数据范围大的输入在模式分类中的作用可能会偏大,而数据范围小的输入作用 阅读全文
posted @ 2013-06-07 19:58 欧小弟 阅读(639) 评论(0) 推荐(0) 编辑
摘要: ah love! could you and i with fate conspireto grasp this sorry scheme of things entire,would not we shatter it to bits--and thenre-mould it nearer to the heart's desire!产生如下输出:ah love! could you and i with fate conspirewould not we shatter it to bits--and thenre-mould it nearer to the heart' 阅读全文
posted @ 2013-06-05 10:42 欧小弟 阅读(228) 评论(0) 推荐(0) 编辑