上一页 1 ··· 141 142 143 144 145 146 147 148 149 ··· 188 下一页
摘要: 枚举类型的定义形式为:enum typeName{ valueName1, valueName2, valueName3, ...... }; enum是一个新的关键字,专门用来定义枚举类型,这也是它在C语言中的唯一用途;typeName是枚举类型的名字;valueName1, valueName2 阅读全文
posted @ 2021-06-17 19:49 myrj 阅读(499) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <time.h>//声明time 时间不可逆转一直在变 #include <math.h> #include <stdlib.h> //<stdlib.h>用于调用 rand(), main() { srand((unsigned)time(0 阅读全文
posted @ 2021-06-17 07:05 myrj 阅读(156) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <stdlib.h> //<stdlib.h>用于调用 rand(), #include <time.h> //声明time 时间不可逆转一直在变 #include <Windows.h> //<Windows.h> 用于清屏 #include 阅读全文
posted @ 2021-06-16 07:21 myrj 阅读(526) 评论(0) 推荐(0)
摘要: 一切都是地址 C语言用变量来存储数据,用函数来定义一段可以重复使用的代码,它们最终都要放到内存中才能供 CPU 使用。数据和代码都以二进制的形式存储在内存中,计算机无法从格式上区分某块内存到底存储的是数据还是代码。当程序被加载到内存后,操作系统会给不同的内存块指定不同的权限,拥有读取和执行权限的内存 阅读全文
posted @ 2021-06-15 15:06 myrj 阅读(871) 评论(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 阅读(379) 评论(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 阅读(767) 评论(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 阅读(677) 评论(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 阅读(238) 评论(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 阅读(2627) 评论(0) 推荐(0)
摘要: 鸿蒙 1。设置--更新 2。华为搜索--抢鲜体验-下载描述文件--同意 3。更新-安装 阅读全文
posted @ 2021-06-12 08:45 myrj 阅读(63) 评论(0) 推荐(0)
上一页 1 ··· 141 142 143 144 145 146 147 148 149 ··· 188 下一页