摘要: 任务4 源代码 点击查看代码 #include <stdio.h> #include <ctype.h> int main() { FILE *fp; int line_count = 0; int char_count = 0; int ch; fp = fopen("data4.txt", "r 阅读全文
posted @ 2025-12-30 23:25 梁宜萱 阅读(8) 评论(1) 推荐(0)
摘要: 任务4 源代码 点击查看代码 #include <stdio.h> #define N 10 typedef struct { char isbn[20]; char name[80]; char author[80]; double sales_price; int sales_count; } 阅读全文
posted @ 2025-12-25 23:35 梁宜萱 阅读(11) 评论(1) 推荐(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 阅读全文
posted @ 2025-12-12 02:01 梁宜萱 阅读(14) 评论(1) 推荐(0)
摘要: 任务一 源代码 ` 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-17 09:39 梁宜萱 阅读(8) 评论(1) 推荐(0)
摘要: 任务1 问题: 功能:判断分数对应的等级;形参:整形;返回值:字符型 每一行后面没有加break,会导致后面的字母都显示出来 源代码: `#include <stdio.h> char score_to_grade(int score); int main (){ int score; char g 阅读全文
posted @ 2025-10-31 02:26 梁宜萱 阅读(11) 评论(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_no; 阅读全文
posted @ 2025-10-19 10:19 梁宜萱 阅读(7) 评论(1) 推荐(0)
摘要: 实验任务1 task1_1 `#include <stdio.h> int main() { printf(" o o \n"); printf(" \n"); printf("I I I I\n"); return 0; } ` 运行结果 task1_2 `#include <stdio.h> i 阅读全文
posted @ 2025-10-09 20:03 梁宜萱 阅读(8) 评论(1) 推荐(0)