摘要: 实验任务4 源代码 #include <stdio.h> #include <ctype.h> int main(){ FILE *fp; char ch; int lines=0; int chars=0; fp=fopen("data4.txt","r"); if(fp==NULL){ prin 阅读全文
posted @ 2025-12-24 20:18 fhe 阅读(13) 评论(1) 推荐(0)
摘要: 实验任务4 源代码 #include <stdio.h> #include <string.h> #define N 10 typedef struct{ char isbn[20]; char name[80]; char author[80]; double sales_price; int s 阅读全文
posted @ 2025-12-24 19:53 fhe 阅读(14) 评论(1) 推荐(0)
摘要: 实验任务1 源代码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 *p 阅读全文
posted @ 2025-12-09 20:38 fhe 阅读(14) 评论(1) 推荐(0)
摘要: 实验任务1 源代码 #include<stdio.h> #define N 4 #define M 2 void test1(){ int x[N]={1,9,8,4}; int i; printf("sizeof(x)=%d\n",sizeof(x)); for(i=0;i<N;++i) prin 阅读全文
posted @ 2025-11-16 13:13 fhe 阅读(14) 评论(1) 推荐(0)
摘要: 实验任务1 源代码 #include<stdio.h> char score_to_grade(int score); int main(){ int score; char grade; while(scanf("%d",&score)!=EOF){ grade=score_to_grade(sc 阅读全文
posted @ 2025-10-28 14:45 fhe 阅读(13) 评论(1) 推荐(0)
摘要: 实验任务1 源代码 #include<stdio.h> #include<stdlib.h> #include<time.h> #define N 5 #define N1 80 #define N2 35 int main(){ int cnt; int random_major,random_n 阅读全文
posted @ 2025-10-16 14:54 fhe 阅读(10) 评论(0) 推荐(1)
摘要: 实验任务1 task1_1 源代码 运行结果 task1_2 源代码 运行结果 实验任务2 源代码 运行结果 实验任务3 源代码 运行结果 问题:现象:运行结果会一闪而过 原因:getchar()可以读取一个字符,如果没有,程序运行完会立即关闭 实验任务4 源代码 运行结果 实验任务5 源代码 运行 阅读全文
posted @ 2025-10-08 00:14 fhe 阅读(18) 评论(1) 推荐(0)