02 2020 档案

摘要:#include "common.h" #include <stdio.h> #include <stdlib.h> #include <math.h> static float test_equation = 0; static char letter_A = '\r'; int main() { 阅读全文
posted @ 2020-02-27 20:35 卷哭你 阅读(167) 评论(0) 推荐(0)
摘要:带有浮点数,默认会转换为double类型存储。 #include "common.h" #include <stdio.h> #include <stdlib.h> #include <math.h> static float test_equation = 0; int main() { //只有 阅读全文
posted @ 2020-02-27 20:17 卷哭你 阅读(451) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2020-02-27 20:10 卷哭你 阅读(173) 评论(0) 推荐(0)
摘要:注意几点: (1)单目和双目,就是单个元素和双个元素. (2)在不同运算符的时候,注意优先级。 (3)同一个语句的时候,注意左右结合性。 其实也很简单 阅读全文
posted @ 2020-02-27 19:52 卷哭你 阅读(107) 评论(0) 推荐(0)
摘要:设变量n为float类型,m为int类型,则以下能实现将n中的数值保留小数点后两位,第三位进行四舍五入运算的表达式____. #include "common.h" #include <stdio.h> #include <stdlib.h> #include <math.h> //#define 阅读全文
posted @ 2020-02-27 19:44 卷哭你 阅读(637) 评论(0) 推荐(0)
摘要:我还纠结着单目运算符和双目运算符和乘除的一些优先级什么事情。 #include "common.h" #include <stdio.h> #include <stdlib.h> #include <math.h> //#define static float Mathematical_modeli 阅读全文
posted @ 2020-02-27 18:23 卷哭你 阅读(170) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2020-02-27 16:58 卷哭你 阅读(130) 评论(0) 推荐(0)
摘要:指数很重要,比如有一些欧拉公式 #include "common.h" #include <stdio.h> #include <stdlib.h> #include <math.h> static float Mathematical_modeling = 0; static int capaci 阅读全文
posted @ 2020-02-27 15:38 卷哭你 阅读(2282) 评论(0) 推荐(0)
摘要:强制转换类型用括号括起来 #include "common.h" #include <stdio.h> #include <stdlib.h> static float Mathematical_modeling = 0; static int capacitance_modeling = 0; i 阅读全文
posted @ 2020-02-27 10:49 卷哭你 阅读(545) 评论(0) 推荐(0)
摘要:取模就是取余,计算机术语和数学术语的差距,余数的好处把数据限制在被除余数里面, 4%5; 等于4; 模数不能浮点数,编译器报不过,必须是整数。 余数的生活案例,吃饭后剩余的东西,还有网吧多余的机器。 模数还有负数,这个比较复杂,先留下个记录。 其实取余,整除法那个多余的数,-7%3 = 3*(-2) 阅读全文
posted @ 2020-02-26 20:30 卷哭你 阅读(912) 评论(0) 推荐(0)
摘要:这个操作可以,爽歪歪。 #include "common.h" #include <stdio.h> #include <stdlib.h> static float test_point = 1.3435; static int normal_point = 1; //8进制g static in 阅读全文
posted @ 2020-02-26 19:26 卷哭你 阅读(679) 评论(0) 推荐(0)
摘要:scanf("xxx%d",&xx); "xxxx%d" 这里不能乱写,这里是标准输入,不然xx的一直不对,和printf不一样,而且%d 和&xx类型要一致, 键盘上输入,输入完成后,要按下一个Enter键,行缓存的问题,详情看<<linux系统编程>>认识会深刻一些, 会有os理解。 阅读全文
posted @ 2020-02-26 18:59 卷哭你 阅读(140) 评论(0) 推荐(0)
摘要:首先是单个字符,是sizeof(char),使用的ASCII转换为数字存储。 控制字符有特别含义,如转行, 这个其实就printf实现的功能,详细需要追踪printf函数的实现,串口打印。 1 #include "common.h" 2 #include <stdio.h> 3 #include < 阅读全文
posted @ 2020-02-26 16:37 卷哭你 阅读(1081) 评论(0) 推荐(0)
摘要:编码:计算机只认识0101,因此要把我们认识文字和英文字符转换为二进制数字。 整型常量分为 整数和字符,整数使用原码存储,字符在内存存取需要转换为数字,这个就是ASCII,当然还有各种中文编码,还有浮点数存取,这个复杂。 整型常量注意一个是使用unsigned 还是signed 区别,最高位明显不一 阅读全文
posted @ 2020-02-26 16:17 卷哭你 阅读(439) 评论(0) 推荐(0)
摘要:我们经常需要打印一些变量的取值来调试程序,使用while(1)是常用的手段。 while (1) { char letter = getchar(); printf("test_point is %d \t\n", test_point); printf("test_point is %f \t\n 阅读全文
posted @ 2020-02-25 18:56 卷哭你 阅读(602) 评论(0) 推荐(0)
摘要:工具下面有一个选项 阅读全文
posted @ 2020-02-25 10:42 卷哭你 阅读(220) 评论(0) 推荐(0)