摘要: 实验任务4 task4.c的源码,运行测试结果如下 #include <stdio.h> #include <ctype.h> int main() { FILE *file; char filename[] = "data4.txt"; int line_count = 0; int char_c 阅读全文
posted @ 2025-06-07 11:08 DownJackring 阅读(7) 评论(0) 推荐(0)
摘要: 实验任务4 task4.c的源码,运行测试结果如下 #include <stdio.h> #define N 10 typedef struct { char isbn[20]; // isbn号 char name[80]; // 书名 char author[80]; // 作者 double 阅读全文
posted @ 2025-06-01 11:21 DownJackring 阅读(5) 评论(0) 推荐(0)
摘要: 实验任务1 task1_1.c和task1_2.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[ 阅读全文
posted @ 2025-05-19 00:04 DownJackring 阅读(5) 评论(0) 推荐(0)
摘要: 实验任务1 task1.c的源码,运行测试结果如下 #include <stdio.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-19 16:59 DownJackring 阅读(5) 评论(0) 推荐(0)
摘要: 实验任务1 task1.c的源码,运行测试结果如下 #include <stdio.h> char score_to_grade(int score); // 函数声明 int main() { int score; char grade; while(scanf("%d", &score) != 阅读全文
posted @ 2025-04-09 11:08 DownJackring 阅读(7) 评论(0) 推荐(0)
摘要: 实验任务1 task1.c的源码,运行测试结果如下 #include <stdio.h> #include <stdlib.h> #include <time.h> #define N 5 int main() { int number; int i; srand(time(0)); // 以当前系 阅读全文
posted @ 2025-03-22 12:07 DownJackring 阅读(8) 评论(0) 推荐(0)
摘要: 实验任务1 task1.1.c,task1.2.c的源码,运行测试结果如下 #include<stdlib.h> int main() { printf(" o \n"); printf("<H>\n"); printf("I I\n"); printf(" o \n"); printf("<H>\ 阅读全文
posted @ 2025-03-10 10:30 DownJackring 阅读(8) 评论(0) 推荐(0)
摘要: 实验任务4: Vector.hpp以及task4.cpp的源码,运行测试结果如下 #pragma once #include<iostream> #include<stdexcept> using std::cout; using std::endl; template <typename T> c 阅读全文
posted @ 2024-12-21 16:14 DownJackring 阅读(6) 评论(0) 推荐(0)
摘要: 实验任务3: task3.cpp和pets.hpp的源码,运行测试结果如下 #pragma once #include<iostream> #include<string> #include<iomanip> using namespace std; class MachinePets{ priva 阅读全文
posted @ 2024-12-07 16:33 DownJackring 阅读(9) 评论(0) 推荐(0)
摘要: 实验任务1: task1-1.cpp和task1-2.cpp以及task1-3.cpp的源码,运行测试结果如下 #include <iostream> using std::cout; using std::endl; // 类A的定义 class A { public: A(int x0, int 阅读全文
posted @ 2024-11-22 11:38 DownJackring 阅读(4) 评论(0) 推荐(0)