Contact me:

11 2020 档案

摘要:让程序读入一组文本行,并打印最长的一行 ##getline函数理解 #include <stdio.h> int c, i; const int n = 99; char l[n]; main() { //处理一行 for (i = 0; (c = getchar()) != EOF && c != 阅读全文
posted @ 2020-11-28 15:53 impwa 阅读(132) 评论(0) 推荐(0)
摘要:• 数组变量本⾝身表达地址,所以 • int a[10]; int*p=a; // ⽆无需⽤用&取地址 • 但是数组的单元表达的是变量,需要⽤用&取地址 • a == &a[0] • []运算符可以对数组做,也可以对指针做: • p[0] ⇐=> a[0] • *运算符可以对指针做,也可以对数组做: 阅读全文
posted @ 2020-11-28 09:16 impwa 阅读(152) 评论(0) 推荐(0)
摘要:1 #include <stdio.h> 2 int k = 222, t = 9; 3 void swap(int *a, int *b); 4 5 main() { 6 swap(&k, &t); 7 printf("\nkkkkkk=%d\nttttttttt=%d", k, t); 8 } 阅读全文
posted @ 2020-11-28 08:57 impwa 阅读(163) 评论(0) 推荐(0)
摘要:#include <stdio.h> int k = 222, t = 9; main() { int (*p) = &k; printf("%d\n%d\n%d", p, *p, &t); } 输出 我个人粗浅的理解 p是一个值,代表所指的地址(也就是&k的值) *p是访问p值的地址,并返回访问地 阅读全文
posted @ 2020-11-25 21:08 impwa 阅读(136) 评论(0) 推荐(0)
摘要:while()后面两个if一直没法平行,找了半天原因结果是没用大括号 花括号中多条语句,逻辑上是一个整体,用来组织层次结构! ##tcpl 1-14(半成品) #include <stdio.h> main() { int cts[26], c, max, i; for (i = 0; i < 26 阅读全文
posted @ 2020-11-23 12:09 impwa 阅读(399) 评论(0) 推荐(0)
摘要:[Error] invalid conversion from 'char' to 'const char*' [-fpermissive] #include <stdio.h> main() { int c, lg[12], i, l; for (c = 0; c < 12; ++c) lg[c] 阅读全文
posted @ 2020-11-23 09:52 impwa 阅读(241) 评论(0) 推荐(0)
摘要:#打印输入单词长度的直方图 #include <stdio.h> main() { int c, lg[12], i; for (c = 0; c < 12; ++c) lg[c] = 0; while ((i = getchar()) != EOF) if (i >= 'a' && i <= 'z 阅读全文
posted @ 2020-11-23 09:37 impwa 阅读(118) 评论(0) 推荐(0)
摘要:![](https://img2020.cnblogs.com/blog/2015058/202011/2015058-20201122112012071-346341932.png) 阅读全文
posted @ 2020-11-22 11:20 impwa 阅读(78) 评论(0) 推荐(0)
摘要:#C一维数组 ##1错误示例 #include <stdio.h> main() { int dgt[10], i; for (i = 0; i < 10; ++i) printf( "% d", "dgt[i]"); } 第一次写的时候没有初始化数组元素,打印结果全是4210688 ##2 #in 阅读全文
posted @ 2020-11-22 10:59 impwa 阅读(299) 评论(0) 推荐(0)
摘要:#习题1-10 ##将输入中的符号替换为可见并输出 #include <stdio.h> /* Run this program on itself (this file) and the following string " " will be only one blank long. */ ma 阅读全文
posted @ 2020-11-21 14:23 impwa 阅读(89) 评论(0) 推荐(0)
摘要:#习题1-9 ##将输入中的连续多个空格替换为一个并输出 ``` #include <stdio.h> /* Run this program on itself (this file) and the following string " " * will be only one blank lo 阅读全文
posted @ 2020-11-21 13:26 impwa 阅读(70) 评论(0) 推荐(0)
摘要:https://ruanyifeng.com/blog/2011/11/eof.html 阅读全文
posted @ 2020-11-21 12:20 impwa 阅读(75) 评论(0) 推荐(0)
摘要:[(http://catalog.mit.edu/degree-charts/computer-science-engineering-course-6-3/)] 阅读全文
posted @ 2020-11-20 23:42 impwa 阅读(200) 评论(0) 推荐(0)
摘要:1.ls – Listls会列举出当前工作目录的内容(文件或文件夹),就跟你在GUI中打开一个文件夹去看里面的内容一样。2.mkdir – Make Directorymkdir <new-directory-name>常见一个新目录3.pwd – Print Working Directorypw 阅读全文
posted @ 2020-11-17 22:43 impwa 阅读(197) 评论(0) 推荐(0)
摘要:来源https://baike.baidu.com/item/%E6%A3%80%E7%B4%A2%E8%A1%A8 定距式 这种形式也叫退格式检索表。在编排时每两个相对应的分支的开头,都编在离左端同等距离的地方,每一个分支的下面,相对应的两个分支的开头,比原分支向右移一个字格,这样编排下去,直到编 阅读全文
posted @ 2020-11-10 17:32 impwa 阅读(2611) 评论(0) 推荐(0)