摘要: 4. 实验任务4: 1 #include<stdio.h> 2 3 int main() 4 { 5 int i = 0; 6 FILE *fp; 7 char str[100]; 8 char ch; 9 10 fp = fopen("data4.txt","r"); 11 if(fp == NU 阅读全文
posted @ 2024-06-24 12:02 青栀% 阅读(36) 评论(0) 推荐(0)
摘要: 4. 实验任务4 1 #include<stdio.h> 2 #define N 10 3 4 typedef struct { 5 char isbn[20]; 6 char name[80]; 7 char author[80]; 8 double sales_price; 9 int sale 阅读全文
posted @ 2024-06-10 13:37 青栀% 阅读(74) 评论(0) 推荐(0)
摘要: 1. 实验任务1 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,in 阅读全文
posted @ 2024-05-24 20:36 青栀% 阅读(39) 评论(0) 推荐(0)
摘要: 1. 实验任务1 task1_1.c 1 #include<stdio.h> 2 #define N 4 3 void test1() 4 { 5 int a[N]={1,9,8,4}; 6 int i; 7 //输出数组a占用的内存字节数 8 printf("sizeof(a)=%d\n",siz 阅读全文
posted @ 2024-05-19 15:06 青栀% 阅读(72) 评论(0) 推荐(0)
摘要: 1. 实验任务1 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,char te 阅读全文
posted @ 2024-04-27 16:17 青栀% 阅读(68) 评论(0) 推荐(0)
摘要: 1. 实验任务1 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<time.h> 4 #define N 5 5 6 int main() 7 { 8 int number; 9 int i; 10 srand(time(0));// 以当前系 阅读全文
posted @ 2024-04-13 18:44 青栀% 阅读(38) 评论(0) 推荐(0)
摘要: task11 #include<stdio.h> 2 #include<stdlib.h> 3 int main() 4 { 5 6 printf(" o \t o\n"); 7 printf("<H>\t <H>\n"); 8 printf("I I\t I I\n"); 9 10 system( 阅读全文
posted @ 2024-03-15 22:25 青栀% 阅读(53) 评论(0) 推荐(0)