上一页 1 ··· 133 134 135 136 137 138 139 140 141 ··· 180 下一页
摘要: 一切都是地址 C语言用变量来存储数据,用函数来定义一段可以重复使用的代码,它们最终都要放到内存中才能供 CPU 使用。数据和代码都以二进制的形式存储在内存中,计算机无法从格式上区分某块内存到底存储的是数据还是代码。当程序被加载到内存后,操作系统会给不同的内存块指定不同的权限,拥有读取和执行权限的内存 阅读全文
posted @ 2021-06-15 15:06 myrj 阅读(727) 评论(0) 推荐(1) 编辑
摘要: 1.自动类型转换:将小范围数据类型转换为大范围的数据类型 2.赋值号两边的数据类型不一致时,会自动将右边的数据类型转换为左边的数据类型。若右边数据的类型级别高,则根据左边变量的长度截取低字节数据部分 int a=259;char b;b=a;//(a=259-256=3) int a=266;cha 阅读全文
posted @ 2021-06-15 09:37 myrj 阅读(320) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int main() { int a,b; //方法一:借助第三个变量 int t; a=1,b=2; t=a; a=b; b=t; printf("%d,%d\n",a,b); //方法二 :先保存两数之和 a=1,b=2; a=a+b; b=a-b; a=a 阅读全文
posted @ 2021-06-15 08:35 myrj 阅读(509) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int main() { int a,b,c,t; /*定义4个基本整型变量a、b、c、t*/ printf("Please input a,b,c:\n"); /*双引号内的普通字符原样输出并换行*/ scanf("%d,%d,%d",&a,&b,&c); / 阅读全文
posted @ 2021-06-15 06:29 myrj 阅读(591) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int main() { int a,b,c,m,t; printf("请输入两个数:\n"); scanf("%d%d",&a,&b); if(a<b) { t=a; a=b; b=t; } m=a*b; c=a%b; while(c!=0) { a=b; b 阅读全文
posted @ 2021-06-14 10:24 myrj 阅读(185) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int main(){ char c; //用户输入的字符 int shu=0;//字符总数 int letters=0, // 字母数目 space=0, // 空格数目 digit=0, // 整数数目 others=0; // 其他字符数目 printf( 阅读全文
posted @ 2021-06-14 09:35 myrj 阅读(2261) 评论(0) 推荐(0) 编辑
摘要: 鸿蒙 1。设置--更新 2。华为搜索--抢鲜体验-下载描述文件--同意 3。更新-安装 阅读全文
posted @ 2021-06-12 08:45 myrj 阅读(48) 评论(0) 推荐(0) 编辑
摘要: 1除法运算:两整数相除,结果为整数; 任意浮点数参与的除法运算结果为浮点型。所以pow(16,1/2)=1 pow(16,1.0/2)=4.00 pow(64,1.0/3)=4.00 球的体积v=4.0/3*3.14*pow(r,3); 三角形面积:d=1.0/2*(a+b+c);s=sqrt(d* 阅读全文
posted @ 2021-06-10 05:30 myrj 阅读(125) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> #include <math.h> #include <stdlib.h> #include <time.h> #define PI 3.1415 /*C语言time(NULL)是以当前时间为种子,产生随意数。 其中,time(NULL)用来获取当前时间,本质上 阅读全文
posted @ 2021-06-08 15:55 myrj 阅读(208) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> main() { int i,a,b,c,d,e; printf("请输入四位整数:\n"); scanf("%d",&i); e=i; a=i%10;b=(i-a)/10%10;c=(i-a-b*10)/100%10;d=i/1000; printf("%d, 阅读全文
posted @ 2021-06-08 06:54 myrj 阅读(1349) 评论(0) 推荐(0) 编辑
上一页 1 ··· 133 134 135 136 137 138 139 140 141 ··· 180 下一页