RealLiuMaoMao

博客园 首页 新随笔 联系 订阅 管理

2022年6月8日 #

摘要: ⚽ 实验任务1:使用指针变量间接访问一维数组元素 1.1 #include <stdio.h> #define N 4 int main() { int x[N] = {1, 9, 8, 4}; int i; int *p; // 方式1:通过数组名和下标遍历输出数组元素 for(i=0; i<N; 阅读全文
posted @ 2022-06-08 23:21 劉毛毛 阅读(77) 评论(1) 推荐(0) 编辑

2022年6月6日 #

摘要: 实验任务1:文本文件数据格式化读写 1.1 #include <stdio.h> #define N 5 #define M 80 typedef struct { char name[M]; // 书名 char author[M]; // 作者 }Book; int main() { Book 阅读全文
posted @ 2022-06-06 21:59 劉毛毛 阅读(42) 评论(1) 推荐(0) 编辑

2022年5月8日 #

摘要: 实验任务1 <1> #include <stdio.h> #define N 4 int main() { int a[N] = {2, 0, 2, 2}; char b[N] = {'2', '0', '2', '2'}; int i; printf("sizeof(int) = %d\n", s 阅读全文
posted @ 2022-05-08 19:31 劉毛毛 阅读(28) 评论(2) 推荐(0) 编辑

2022年4月21日 #

摘要: 1. #include<stdio.h>#include<stdlib.h>#include<time.h>#include<windows.h>#define N 80 void printText(int line,int col, char text[]);void printSpaces(i 阅读全文
posted @ 2022-04-21 17:50 劉毛毛 阅读(57) 评论(1) 推荐(0) 编辑

2022年4月14日 #

摘要: 1. #include <stdio.h> #include <stdlib.h> #include <time.h> #define N 5 int main() { int grade, number; int i; srand(time(0)); // 以当前系统时间作为随机种子 for(i= 阅读全文
posted @ 2022-04-14 11:32 劉毛毛 阅读(51) 评论(4) 推荐(0) 编辑

2022年3月23日 #

摘要: 实验任务1 <1> #include <stdio.h> int main() { printf(" O \n"); printf("<H>\n"); printf("I I\n"); printf("\n O \n"); printf("<H>\n"); printf("I I\n"); retu 阅读全文
posted @ 2022-03-23 19:00 劉毛毛 阅读(41) 评论(3) 推荐(0) 编辑