多余的string函数 摘要:解题思路:#include<stdio.h> #include<string.h> int main(void) { char a[100]; gets(a); i…… 题解列表 2024年12月28日 0 点赞 0 评论 394 浏览 评分:0.0
二维数组的转置 摘要:解题思路:#include<stdio.h> int main(void) { int a[3][3] = { {1, 2, 3}, &nbs 题解列表 2024年12月28日 1 点赞 0 评论 570 浏览 评分:0.0
自定义函数处理素数 摘要:#include<stdio.h> int judge(int n); int main(void) { int n; while(scanf("%d", &n)) …… 题解列表 2024年12月28日 2 点赞 0 评论 946 浏览 评分:0.0
用冒泡排序的方法解决 摘要:解题思路: 通过交换相邻元素的方式将元素依次向前移动一位,实现将数组的后 m 个元素循环前移到数组前面。注意事项: 注意输入的 m 值不能超过数组的长度,否则可能会出现越界错误。代码中使用了变长数组(…… 题解列表 2024年12月28日 2 点赞 0 评论 387 浏览 评分:10.0
2163二分法查找最接近的元素 摘要:解题思路:注意事项:在比较的时候需要注意取绝对值(abs函数)比较,不然会出错。参考代码:#include <bits/stdc++.h>using namespace std;int findClo…… 题解列表 2024年12月28日 0 点赞 0 评论 391 浏览 评分:10.0
1768: 循环入门练习5题解 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int n; cin>>n; for(in…… 题解列表 2024年12月28日 0 点赞 0 评论 195 浏览 评分:0.0
1767: 循环入门练习4题解 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int sum=0; int n; cin…… 题解列表 2024年12月28日 0 点赞 0 评论 110 浏览 评分:0.0
1575递归倒置字符c++递归法简单明了解决方案 摘要:解题思路:此处使用swap方法进行字符交换,可以使代码更简洁更简单,只需要在定义的一个方法中传输该字符与字符数组左右的边界。当左边界大于等一有边界就可以返回了,这样也可以使得输入n=1时也能返回。再使…… 题解列表 2024年12月28日 0 点赞 0 评论 452 浏览 评分:10.0
1199哥德巴赫曾猜测c++简洁题解 摘要:解题思路:首先需要一个方法来判断一个数字是否为素数,这样可以做到简略代码量的工作。判断两个素数加起来是否为输入的数字时,只需要判断第i个与第n-i个是不是素数就行了,不需要多判断二者相加。注意事项:因…… 题解列表 2024年12月28日 2 点赞 0 评论 397 浏览 评分:6.0
编写题解 1051: [编程入门]结构体之成绩统计2(注释清晰 简单易懂) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>struct student { …… 题解列表 2024年12月27日 3 点赞 0 评论 924 浏览 评分:10.0