摘要: // 现代C++标准库、算法库体验 // 本例用到以下内容: // 1. 字符串string, 动态数组容器类vector、迭代器 // 2. 算法库:反转元素次序、旋转元素 // 3. 函数模板、const引用作为形参 #include <iostream> #include <string> # 阅读全文
posted @ 2025-10-17 11:37 星空织梦 阅读(10) 评论(1) 推荐(0)
摘要: #include <stdio.h> void x (const char *filePath) { FILE *file = fopen(filePath, "r"); int a = 0; int b = 0; if (file == NULL) { printf("无法打开文件\n"); re 阅读全文
posted @ 2024-12-28 21:32 星空织梦 阅读(12) 评论(0) 推荐(0)
摘要: #include <stdio.h> #include <string.h> #define N 10 typedef struct { char isbn[20]; // isbn号 char name[80]; // 书名 char author[80]; // 作者 double sales_ 阅读全文
posted @ 2024-12-19 14:21 星空织梦 阅读(3) 评论(0) 推荐(0)
摘要: #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, int *pmax); int m 阅读全文
posted @ 2024-12-08 10:34 星空织梦 阅读(16) 评论(0) 推荐(0)
摘要: #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=0;i<N;++i) printf("%p:% 阅读全文
posted @ 2024-11-10 11:01 星空织梦 阅读(11) 评论(0) 推荐(0)
摘要: `#include<stdio.h> char score_to_grade(int score); int main(){ int score; char grade; while(scanf("%d",&score)!=EOF){ grade = score_to_grade(score); p 阅读全文
posted @ 2024-10-29 21:41 星空织梦 阅读(14) 评论(0) 推荐(0)
摘要: 点击查看代码 #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; int rand 阅读全文
posted @ 2024-10-13 10:31 星空织梦 阅读(11) 评论(0) 推荐(0)
摘要: include <stdio.h> int main() { printf(" O \n"); printf("\n"); printf("I I\n"); return 0; } int main() { printf(" O \n"); printf("\n"); printf("I I\n") 阅读全文
posted @ 2024-10-09 21:58 星空织梦 阅读(8) 评论(0) 推荐(0)
摘要: 1 阅读全文
posted @ 2024-09-26 16:54 星空织梦 阅读(13) 评论(0) 推荐(1)