上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页
摘要: 都是用来字符串读一行 不同的是:fgets会自动添加换行符 很多字符串操作需要手动添加'\0' //处理方式 while (fgets(buf, sizeof(buf), stdin)) { // 移除末尾的换行符 换成结束符'\0' int len = strlen(buf); if (len = 阅读全文
posted @ 2024-11-10 22:30 某朝 阅读(44) 评论(0) 推荐(0)
摘要: c/c++整行读入字符串 阅读全文
posted @ 2024-11-10 16:37 某朝 阅读(17) 评论(0) 推荐(0)
摘要: 二叉树的镜像 左右树互换 Tree dfs(Tree T) { if (T == NULL)return NULL; Tree tmp = T->Left; T->Left = dfs(T->Right); T->Right = dfs(tmp); return T; } 阅读全文
posted @ 2024-11-08 21:22 某朝 阅读(11) 评论(0) 推荐(0)
摘要: 简单讲解 阅读全文
posted @ 2024-11-07 23:41 某朝 阅读(16) 评论(0) 推荐(0)
摘要: csdn 一个m*n的矩阵和一个n*p的矩阵相乘,将会得到一个m*p的矩阵 #include<iostream> #include<cstring> using namespace std; int main() { int a[110][110]={}; int b[110][110]={}; i 阅读全文
posted @ 2024-11-07 16:04 某朝 阅读(33) 评论(0) 推荐(0)
摘要: Description 索隆是有名的路痴,为了不让索隆走丢,娜美给了索隆一本地图。该地图有N个城市,编号从1到N。每个城 市有个代号,索隆每到一个城市只能知道该城市的代号而不知道该城市的编号,现有一份编号与代号对应的 清单,你能帮索隆尽快地找到所在城市的编号吗? Input 输入第一行为两个正整数N 阅读全文
posted @ 2024-11-06 11:34 某朝 阅读(43) 评论(0) 推荐(0)
摘要: 第1题(教材第10章“编程练习”的第3题): #include <stdio.h> #define N 110 int a[N]; int main() { int maxx = -10000; int n; scanf("%d", &n); for (int i = 0; i < n; i++) 阅读全文
posted @ 2024-11-04 22:17 某朝 阅读(33) 评论(0) 推荐(0)
摘要: 函数原型 下列程序输入3个整数(3个数之和不会超过整型数的最大值),计算并输出它们的平均值。下划线填入那个(些)行既不会导致编译错误也不会导致编译警告。 #include <stdio.h> ______________________________________________________ 阅读全文
posted @ 2024-11-02 22:04 某朝 阅读(28) 评论(0) 推荐(0)
摘要: #include <stdio.h> int gcd(int a, int b) { if (a % b == 0) { return b; } else { return gcd(b, a % b); } } int main() { int num1, num2; printf("Enter f 阅读全文
posted @ 2024-11-01 20:09 某朝 阅读(28) 评论(0) 推荐(0)
摘要: #include<iostream> #include<string> using namespace std; const int N = 10010; //A 65 0 int a[N]; string v[510]; int Hash(const int* Key, int TableSize 阅读全文
posted @ 2024-10-30 21:47 某朝 阅读(16) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 11 下一页