摘要: 任务1:源代码: 1 #pragma once 2 3 #include <vector> 4 #include <array> 5 #include <string> 6 7 class GradeCalc { 8 public: 9 GradeCalc(const std::string &cn 阅读全文
posted @ 2025-11-29 10:37 lei1459 阅读(8) 评论(1) 推荐(0)
摘要: 任务1:源代码: 1 #include "window.hpp" 2 #include <iostream> 3 4 void test(){ 5 Window w("Demo"); 6 w.add_button("add"); 7 w.add_button("remove"); 8 w.add_b 阅读全文
posted @ 2025-11-23 16:55 lei1459 阅读(10) 评论(1) 推荐(0)
摘要: 任务1: 源代码: 1 #pragma once 2 3 #include <string> 4 5 // 类T: 声明 6 class T { 7 // 对象属性、方法 8 public: 9 T(int x = 0, int y = 0); // 普通构造函数 10 T(const T &t); 阅读全文
posted @ 2025-10-28 20:34 lei1459 阅读(7) 评论(1) 推荐(0)
摘要: 任务1: 源代码: 1 // 现代C++标准库、算法库体验 2 // 本例用到以下内容: 3 // 1. 字符串string, 动态数组容器类vector、迭代器 4 // 2. 算法库:反转元素次序、旋转元素 5 // 3. 函数模板、const引用作为形参 6 7 #include <iostr 阅读全文
posted @ 2025-10-15 20:16 lei1459 阅读(20) 评论(1) 推荐(0)
摘要: task4: 1 #include<stdio.h> 2 int main() 3 { 4 char a; 5 int count=0; 6 FILE *fp; 7 fp = fopen("data4.txt","r"); 8 if(fp==NULL) { 9 printf("fail to ope 阅读全文
posted @ 2023-12-19 09:52 lei1459 阅读(15) 评论(0) 推荐(0)
摘要: task4: 1 #include <stdio.h> 2 #define N 10 3 4 typedef struct { 5 char isbn[20]; // isbn号 6 char name[80]; // 书名 7 char author[80]; // 作者 8 double sal 阅读全文
posted @ 2023-12-17 20:56 lei1459 阅读(56) 评论(0) 推荐(0)
摘要: task1_1: 1 #include <stdio.h> 2 #define N 5 3 4 void input(int x[], int n); 5 void output(int x[], int n); 6 void find_min_max(int x[], int n, int *pm 阅读全文
posted @ 2023-11-30 20:28 lei1459 阅读(19) 评论(0) 推荐(0)
摘要: task1-1 1 #include <stdio.h> 2 #define N 4 3 4 void test1() { 5 int a[N] = {1, 9, 8, 4}; 6 int i; 7 8 // 输出数组a占用的内存字节数 9 printf("sizeof(a) = %d\n", si 阅读全文
posted @ 2023-11-15 20:01 lei1459 阅读(25) 评论(0) 推荐(0)
摘要: task.1 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <time.h> 4 #include <windows.h> 5 #define N 80 6 7 void print_text(int line, int col, cha 阅读全文
posted @ 2023-11-01 21:19 lei1459 阅读(17) 评论(0) 推荐(0)
摘要: Task1: 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<time.h> 4 5 #define N 5 6 #define N1 374 7 #define N2 465 8 9 int main() 10 { 11 int number 阅读全文
posted @ 2023-10-21 15:48 lei1459 阅读(13) 评论(0) 推荐(0)