上一页 1 ··· 3 4 5 6 7 8 下一页
摘要: #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<string.h> #include<stdlib.h> #include<math.h> #include<time.h> int main01() { int a =10; // 阅读全文
posted @ 2020-08-05 19:08 wh19991213 阅读(599) 评论(0) 推荐(0) 编辑
摘要: 1)有符号字符型:(signed char)8bit数据存储区间为-2^7——2^7-1;-128——127 8bit数据最大存储值/一定是正数 原/反/补码:0 111 1111=1000 0000-1=2^7-1=127//最大值 8bit数据最小存储值 原码:1111 1111=-127 反码 阅读全文
posted @ 2020-08-05 11:48 wh19991213 阅读(884) 评论(0) 推荐(0) 编辑
摘要: 1)原码:一个数的原码(原始的二进制码)有如下特点: 最高位做为符号位,0表示正,1表示负 其它数值部分就是数值本身绝对值的二进制数 负数的原码是在其绝对值的基础上,最高位变为1 原码表示法简单易懂,与带符号数本身转换方便,只要符号还原即可,但当两个正数相减或不同符号数相加时,必须比较两个数哪个绝对 阅读全文
posted @ 2020-08-04 09:26 wh19991213 阅读(812) 评论(0) 推荐(0) 编辑
摘要: #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<string.h> #include<stdlib.h> #include<math.h> #include<time.h> int main() { /*实型变量也可以称为浮点型变 阅读全文
posted @ 2020-08-01 19:12 wh19991213 阅读(774) 评论(0) 推荐(0) 编辑
摘要: #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<string.h> #include<stdlib.h> #include<math.h> #include<time.h> int main() { /*char:字符型变量,只能 阅读全文
posted @ 2020-08-01 18:13 wh19991213 阅读(293) 评论(0) 推荐(0) 编辑
摘要: #define _CRT_SECURE_NO_WARNINGS #include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>#include<time.h> int main() { //整型变量 int a=10; // 阅读全文
posted @ 2020-07-31 19:40 wh19991213 阅读(1347) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int main02(void){ //进制(在计算机定义数据时,不可以直接定义二进制) //二进制(0-1); 八进制(0-7); 十六进制(0-9,a-f或A-F) int a = 10; printf("%d\n", a); //%x:占位符,输出一个十六 阅读全文
posted @ 2020-07-30 15:54 wh19991213 阅读(83) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> int main(void) { //singed:有符号,可以省略 signed int a=-10;//err //unsinged:无符号,只能定义正数,否则乱码(一个无符号数据需要使用%u去打印) unsigned int b=-10; printf("% 阅读全文
posted @ 2020-07-30 15:52 wh19991213 阅读(189) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> //宏定义常量,可直接定义常量 #define pi 3.14159 圆的面积s=pi*r*r;圆的周长l=2*pi*r;圆的半径3 int main(void) { //auto:定义局部变量(在函数内部定义的变量),可在数据类型前加修饰,可加可不加 //flo 阅读全文
posted @ 2020-07-30 15:36 wh19991213 阅读(256) 评论(0) 推荐(0) 编辑
摘要: //由于微软在VS中不建议再使用C的传统库函数scanf,strcpy,sprintf等,所以直接使用这些库函数会提示C4996错误 //解决方法:#define _CRT_SECURE_NO_WARNINGS且只能在首行或者#pragma warning(disable:4996) #define 阅读全文
posted @ 2020-07-30 15:17 wh19991213 阅读(59) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 下一页