摘要: 4. #include <stdio.h> #include<stdlib.h> int main(){ FILE *fp; fp = fopen("E:\c++实验\data4.txt", "r"); if (!fp) { printf("fail to open the file"); syst 阅读全文
posted @ 2025-06-09 11:06 海浪无声夜幕深深 阅读(10) 评论(0) 推荐(0)
摘要: 4. #include <stdio.h> #include <stdlib.h> #define N 10 typedef struct { char isbn[20]; // ISBN号 char name[80]; // 书名 char author[80]; // 作者 double sal 阅读全文
posted @ 2025-06-02 23:17 海浪无声夜幕深深 阅读(12) 评论(0) 推荐(0)
摘要: 1.task.1 #include <stdio.h> #include<stdlib.h> #define N 5 void input(int x[], int n); void output(int x[], int n); void find_min_max(int x[], int n, 阅读全文
posted @ 2025-05-18 23:02 海浪无声夜幕深深 阅读(14) 评论(0) 推荐(0)
摘要: 1. #include <stdio.h> #include<stdlib.h> #define N 4 #define M 2 void test1() { int x[N] = {1, 9, 8, 4}; int i; // 输出数组x占用的内存字节数 printf("sizeof(x) = % 阅读全文
posted @ 2025-04-20 23:13 海浪无声夜幕深深 阅读(20) 评论(0) 推荐(0)
摘要: 1. #include <stdio.h> #include<stdlib.h> char score_to_grade(int score); // 函数声明 int main() { int score; char grade; while(scanf("%d", &score) != EOF) 阅读全文
posted @ 2025-04-09 22:43 海浪无声夜幕深深 阅读(20) 评论(0) 推荐(0)
摘要: 1. #include <stdio.h> #include<stdlib.h> int main() { printf(" o o \n"); printf(" /|\\/|\\/ \n"); printf(" I I I I\n"); printf(" | |\n"); system("paus 阅读全文
posted @ 2025-03-24 00:03 海浪无声夜幕深深 阅读(18) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2025-03-23 22:18 海浪无声夜幕深深 阅读(18) 评论(0) 推荐(0)