2021年7月28日
摘要: 1 #include <stdio.h> 2 #include <stdlib.h> 3 int main() 4 { 5 int price = 150; 6 int guess ; 7 int i = 0; 8 9 10 for(;i<5 ;i++) 11 { 12 13 printf("请输入 阅读全文
posted @ 2021-07-28 12:02 Bytezero! 阅读(183) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> int main() { int i =1; int sum = 0; for(i = 0; i <101; i++) { if( i % 2 == 0) { sum += i; } } printf("%d\n",sum); } 阅读全文
posted @ 2021-07-28 12:00 Bytezero! 阅读(485) 评论(0) 推荐(0) 编辑
摘要: C 语言支持数组数据结构,它可以存储一个固定大小的相同类型元素的顺序集合。数组是用来存储一系列数据,但它往往被认为是一系列相同类型的变量。 数组的声明并不是声明一个个单独的变量,比如 runoob0、runoob1、...、runoob99,而是声明一个数组变量,比如 runoob,然后使用 run 阅读全文
posted @ 2021-07-28 11:57 Bytezero! 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 int main() 3 { 4 int nums[] = {8,4,2,1,23,344,12}; 5 int i; 6 int sum = 0; 7 double avg; 8 9 int searchNum; 10 11 //打印 数组里的元素 1 阅读全文
posted @ 2021-07-28 11:55 Bytezero! 阅读(64) 评论(0) 推荐(0) 编辑
摘要: 1 //动态录入 2 3 #include <stdio.h> 4 # define N 5 5 int main() 6 { 7 8 double score[5]; //数组5 个元素 9 int i; // 循环变量 10 for(i = 0; i < N; i++) 11 { 12 prin 阅读全文
posted @ 2021-07-28 11:54 Bytezero! 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #define N 7 3 4 int main() 5 { 6 7 int nums [N] = {10,85,96,5,9,6,200}; //定义了一个数组,里面有 7 个元素 8 int i ,j; 9 int temp; 10 11 //外层循 阅读全文
posted @ 2021-07-28 11:50 Bytezero! 阅读(490) 评论(0) 推荐(0) 编辑
摘要: 1 //数组 查询 增加 删除 排序 2 3 #include <stdio.h> 4 int main() 5 { 6 7 double power[] = {100,855,600,8960,20}; //定义一个战斗力的数组 8 int count = 5; //元素个数为5 9 10 dou 阅读全文
posted @ 2021-07-28 11:49 Bytezero! 阅读(45) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 int main() 3 { 4 //使用二维数组 进行的打印 5 double scores[4][3] = {{87,56,89},{98,55,46},{98,65,56},{98,65,23}}; 6 int i,j; 7 for(i = 0; i 阅读全文
posted @ 2021-07-28 11:45 Bytezero! 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 1 //皇帝游戏 2 3 //EmperroGame 4 #include <stdio.h> 5 #include <windows.h> 6 #include <mmsystem.h> 7 #include <stdlib.h> 8 #include <string.h> 9 #include 阅读全文
posted @ 2021-07-28 11:40 Bytezero! 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 学习 C 语言的指针既简单又有趣。通过指针,可以简化一些 C 编程任务的执行,还有一些任务,如动态内存分配,没有指针是无法执行的。所以,想要成为一名优秀的 C 程序员,学习指针是很有必要的。 正如您所知道的,每一个变量都有一个内存位置,每一个内存位置都定义了可使用 & 运算符访问的地址,它表示了在内 阅读全文
posted @ 2021-07-28 11:38 Bytezero! 阅读(44) 评论(0) 推荐(0) 编辑