摘要: 4. 实验任务4:文件简单应用 #include <stdio.h> #include <stdlib.h> void countLinesAndChars(const char *fileName) { FILE *fp; int lines = 0, chars = 0; int ch; int 阅读全文
posted @ 2024-12-30 08:47 阳光小狗 阅读(14) 评论(0) 推荐(0)
摘要: 4. 实验任务4 #include <stdio.h> #define N 10 typedef struct { char isbn[20]; char name[80]; char author[80]; double sales_price; int sales_count; } Book; 阅读全文
posted @ 2024-12-22 14:40 阳光小狗 阅读(10) 评论(0) 推荐(0)
摘要: 1. 实验任务1 task1_1.c #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 @ 2024-12-08 00:16 阳光小狗 阅读(48) 评论(0) 推荐(0)
摘要: 1. 实验任务1 task1 #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 阅读全文
posted @ 2024-11-10 23:51 阳光小狗 阅读(26) 评论(0) 推荐(0)
摘要: 1、实验任务1 task1.c #include <stdio.h> #include <stdlib.h> #include <time.h> #define N 5 #define N1 397 #define N2 476 #define N3 21 int main() { int cnt; 阅读全文
posted @ 2024-10-15 15:49 阳光小狗 阅读(16) 评论(0) 推荐(0)
摘要: 1. 实验任务1 task1_1.c #include<stdio.h> int main() { printf(" o \n"); printf("<H>\n"); printf("I I\n"); printf(" o \n"); printf("<H>\n"); printf("I I\n") 阅读全文
posted @ 2024-10-01 16:46 阳光小狗 阅读(24) 评论(0) 推荐(0)