2020年4月24日
摘要: #include <stdio.h> int main() { printf(" 打印输入字符频度的直方图 \n"); unsigned int ws[128]; // 字符频度数组。 int i, j, c; i = j = c = 0; // 默认每个字符出现0次。 for (i = 0; i 阅读全文
posted @ 2020-04-24 19:55 杪杪 阅读(342) 评论(0) 推荐(0)
摘要: /*水平方向的直方图*/ 1 #include <stdio.h> 2 #define MAXHIST 15 3 #define MAXWORD 11 4 #define IN 1 5 #define OUT 0 6 7 int main() 8 { 9 10 int c, i, nc, state 阅读全文
posted @ 2020-04-24 15:56 杪杪 阅读(504) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 #define IN 1 3 #define OUT 0 4 5 int main() 6 { 7 int c, state; 8 state = OUT; 9 10 while( (c = getchar()) != EOF) 11 12 { 13 i 阅读全文
posted @ 2020-04-24 11:06 杪杪 阅读(426) 评论(0) 推荐(0)
  2020年4月23日
摘要: 1 #include <stdio.h> 2 3 #define IN 1 4 #define OUT 0 5 6 /*统计各个数字、空白符及其他字符出现的次数*/ 7 8 int main() 9 { 10 int c, n1, nw, nc, state; 11 12 state = OUT; 阅读全文
posted @ 2020-04-23 22:31 杪杪 阅读(398) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 #include <stdlib.h> 3 int main() 4 { 5 int c; 6 while ((c=getchar())!=EOF){ /*判断输入字符是否为文件结束符*/ 7 if (c=='\t') /*如果输入字符为制表符*/ 8 阅读全文
posted @ 2020-04-23 21:54 杪杪 阅读(663) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 #include <stdlib.h> 3 int main() 4 { 5 int space=0, tab=0, line=0, c; 6 while ((c=getchar())!=EOF){ 7 if (c==' ') 8 ++space; 9 阅读全文
posted @ 2020-04-23 21:49 杪杪 阅读(453) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 #include <stdlib.h> 3 int main() 4 { 5 printf("%d\n", EOF); 6 system("pause"); 7 return 0; 8 } 阅读全文
posted @ 2020-04-23 21:46 杪杪 阅读(836) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 #include <stdlib.h> 3 int main() 4 { 5 int c, space=0; 6 while ((c=getchar())!=EOF){ 7 if (c==' ') 8 ++space; 9 else 10 space=0 阅读全文
posted @ 2020-04-23 21:39 杪杪 阅读(337) 评论(0) 推荐(0)
  2019年12月3日
摘要: #运算符 #运算符用于在预处理期将宏参数转换为字符串 #的转换作用是在预处理期完成的,因此只在宏定义中有效 编译器不知道#的转换作用 1 #define STRING(x) #x2 printf("%s\n",STRING(Hello World!)); ##运算符 ##运算符用于在预处理期粘连两个 阅读全文
posted @ 2019-12-03 15:22 杪杪 阅读(376) 评论(0) 推荐(0)
  2019年11月24日
摘要: histfit是带正态拟合的频率直方图我们用命令normrnd生成符合正态分布的随机数.normrnd(u,v,m,n)其中,u表示生成随机数的期望,v代表随机数的方差.运行: a=normrnd(10,2,10000,1); histfit(a) %% 我们可以得到正态分布的统计直方图与其正态分布 阅读全文
posted @ 2019-11-24 15:27 杪杪 阅读(5466) 评论(0) 推荐(0)