摘要: task1.c 1 #include <stdio.h> 2 #define N 4 3 #define M 2 4 5 void test1() { 6 int x[N] = {1, 9, 8, 4}; 7 int i; 8 9 // 输出数组x占用的内存字节数 10 printf("sizeof 阅读全文
posted @ 2025-11-17 14:19 ToffeeMa 阅读(11) 评论(1) 推荐(0)
摘要: 1. 实验任务1 task1.c 1 #include <stdio.h> 2 3 char score_to_grade(int score); // 函数声明 4 5 int main() { 6 int score; 7 char grade; 8 9 while (scanf_s("%d", 阅读全文
posted @ 2025-10-30 17:07 ToffeeMa 阅读(7) 评论(1) 推荐(0)
摘要: 实验任务1 task1.c 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <time.h> 4 5 #define N 5 6 #define N1 80 7 #define N2 35 8 9 int main() { 10 int c 阅读全文
posted @ 2025-10-17 17:25 ToffeeMa 阅读(13) 评论(1) 推荐(0)
摘要: 实验任务1 task1.cpp 1 // 现代C++标准库、算法库体验 2 // 本例用到以下内容: 3 // 1. 字符串string, 动态数组容器类vector、迭代器 4 // 2. 算法库:反转元素次序、旋转元素 5 // 3. 函数模板、const引用作为形参 6 #include <i 阅读全文
posted @ 2025-10-17 16:51 ToffeeMa 阅读(12) 评论(1) 推荐(0)
摘要: task1_1.c 1 #include <stdio.h> 2 int main() 3 { 4 printf(" O \n"); 5 printf("<H>\n"); 6 printf("I I\n"); 7 printf(" O \n"); 8 printf("<H>\n"); 9 print 阅读全文
posted @ 2025-10-09 17:26 ToffeeMa 阅读(31) 评论(1) 推荐(0)