摘要: 4.task.4 #include<stdio.h> int main(){ FILE *fp; char ch; int count=0; fp=fopen("d:\\data4.txt","r"); if(fp==NULL){ printf("fail to open file\n"); ret 阅读全文
posted @ 2024-06-24 09:46 中年男士 阅读(17) 评论(0) 推荐(0)
摘要: 1.task.1 #define N 3 // 运行程序输入测试时,可以把这个数组改小一些输入测试 #include<stdlib.h> typedef struct student { int id; // 学号 char name[20]; // 姓名 char subject[20]; // 阅读全文
posted @ 2024-06-10 02:43 中年男士 阅读(31) 评论(0) 推荐(0)
摘要: task1.1 #include <stdio.h> #define N 5 void input(int x[], int n); void output(int x[], int n); void find_min_max(int x[], int n, int *pmin, int *pmax 阅读全文
posted @ 2024-05-27 12:58 中年男士 阅读(10) 评论(0) 推荐(0)
摘要: task1.c 1 void test1() { 2 int a[N] = { 1, 9, 8, 4 }; 3 int i; 4 5 // 输出数组a占用的内存字节数 6 printf("sizeof(a) = %d\n", sizeof(a)); 7 8 // 输出int类型数组a中每个元素的地址 阅读全文
posted @ 2024-05-19 21:32 中年男士 阅读(10) 评论(0) 推荐(0)
摘要: 1.任务1 #include <stdio.h> #include <stdlib.h> #include <time.h> #include <windows.h> #define N 80 void print_text(int line, int col, char text[]); // 函 阅读全文
posted @ 2024-04-28 23:14 中年男士 阅读(18) 评论(0) 推荐(0)
摘要: 1.实验任务1 #include<stdio.h> #include<stdlib.h> #include<time.h> #define N 5 int main() { int number; int i; srand(time(0)); for(i=0;i<N;++i) { number=ra 阅读全文
posted @ 2024-04-14 23:39 中年男士 阅读(11) 评论(0) 推荐(0)
摘要: 1 #include<stdio.h> 2 #include<stdlib.h> 3 int main() 4 { 5 printf(" o\n"); 6 printf("<H>\n"); 7 printf("I I\n"); 8 printf(" o\n"); 9 printf("<H>\n"); 阅读全文
posted @ 2024-03-16 23:31 中年男士 阅读(19) 评论(0) 推荐(0)