摘要: task4.c 1 #include <stdio.h> 2 int main() 3 { 4 FILE *fp; 5 char ch; 6 int count=0; 7 fp=fopen("data4.txt","r"); 8 if(fp == NULL) 9 { 10 printf("fail 阅读全文
posted @ 2024-06-17 18:36 陈禹硕123 阅读(28) 评论(0) 推荐(0)
摘要: task4.c 1 #include <stdio.h> 2 #define N 10 3 4 typedef struct { 5 char isbn[20]; // isbn号 6 char name[80]; // 书名 7 char author[80]; // 作者 8 double sa 阅读全文
posted @ 2024-06-03 18:45 陈禹硕123 阅读(39) 评论(0) 推荐(0)
摘要: task1_1.c 1 #include <stdio.h> 2 #define N 5 3 4 void input(int x[], int n); 5 void output(int x[], int n); 6 void find_min_max(int x[], int n, int *p 阅读全文
posted @ 2024-05-20 20:24 陈禹硕123 阅读(50) 评论(0) 推荐(0)
摘要: task1_1.c 1 #include <stdio.h> 2 #define N 4 3 4 void test1() { 5 int a[N] = {1, 9, 8, 4}; 6 int i; 7 8 // 输出数组a占用的内存字节数 9 printf("sizeof(a) = %d\n", 阅读全文
posted @ 2024-05-17 16:52 陈禹硕123 阅读(54) 评论(0) 推荐(0)
摘要: task1.c 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <time.h> 4 #include <windows.h> 5 #define N 80 6 7 void print_text(int line, int col, ch 阅读全文
posted @ 2024-04-23 17:44 陈禹硕123 阅读(24) 评论(0) 推荐(0)
摘要: task1.c 问题一:生成1~65中的随机数 问题二:随机生成5个本班学号 task2.c 1 #include <stdio.h> 2 int main() 3 { 4 char colour; 5 printf("请输入交通信号灯的颜色:"); 6 while ((colour = getch 阅读全文
posted @ 2024-04-08 20:04 陈禹硕123 阅读(31) 评论(0) 推荐(0)
摘要: task1_1 1 #include <stdio.h> 2 int main() 3 { 4 printf(" O\n"); 5 printf("<H>\n"); 6 printf("I I\n"); 7 8 printf(" O\n"); 9 printf("<H>\n"); 10 printf 阅读全文
posted @ 2024-03-13 19:25 陈禹硕123 阅读(67) 评论(0) 推荐(0)