编写题解 1051: [编程入门]结构体之成绩统计2(注释清晰 简单易懂) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>struct student { …… 题解列表 2024年12月27日 3 点赞 0 评论 1450 浏览 评分:10.0
1575递归倒置字符c++递归法简单明了解决方案 解题思路:此处使用swap方法进行字符交换,可以使代码更简洁更简单,只需要在定义的一个方法中传输该字符与字符数组左右的边界。当左边界大于等一有边界就可以返回了,这样也可以使得输入n=1时也能返回。再使用swap交换左右的字符即可完成首次倒置。 题解列表 2024年12月28日 0 点赞 0 评论 868 浏览 评分:10.0
2163二分法查找最接近的元素 摘要:解题思路:注意事项:在比较的时候需要注意取绝对值(abs函数)比较,不然会出错。参考代码:#include <bits/stdc++.h>using namespace std;int findClo…… 题解列表 2024年12月28日 1 点赞 0 评论 818 浏览 评分:10.0
用冒泡排序的方法解决 摘要:解题思路: 通过交换相邻元素的方式将元素依次向前移动一位,实现将数组的后 m 个元素循环前移到数组前面。注意事项: 注意输入的 m 值不能超过数组的长度,否则可能会出现越界错误。代码中使用了变长数组(…… 题解列表 2024年12月28日 3 点赞 0 评论 773 浏览 评分:10.0
有点思维难度 摘要:解题思路:注意事项:参考代码:#include<stdio.h> int main(void) { int n, i; scanf("%d", &n); int a[…… 题解列表 2024年12月28日 1 点赞 1 评论 549 浏览 评分:10.0
初学者思路,简单易懂 摘要:解题思路:从字符数组的两边往中间开始交换注意事项:参考代码: #include<stdio.h> #include<string.h> void fun(char*); int main()…… 题解列表 2024年12月29日 12 点赞 1 评论 1676 浏览 评分:10.0
这题的有问题 摘要:#include<stdio.h> int ans(int n); int main(void) { int to, from, temp; int i, j; i…… 题解列表 2024年12月29日 0 点赞 1 评论 492 浏览 评分:10.0
有点懵,搞不清楚二维和一维使用 摘要:解题思路:注意事项:参考代码#include<iostream>using namespace std;int n, m;int a[5010], b[5010], dp[5010];int main…… 题解列表 2024年12月29日 1 点赞 0 评论 518 浏览 评分:10.0
数位dp #2490: 信息学奥赛一本通T1586-数字游戏(C++) 看注释 ```#includeusingnamespacestd;constintN=15;//I位数字且最高位是J的不降数的个数intf[N][N];voidinit(){//一位数的不降数只有一种for(inti=0;i 题解列表 2024年12月30日 2 点赞 0 评论 1036 浏览 评分:10.0
简单的回文数 摘要:#include<stdio.h> int judge(int n); int main(void) { int i = 95859, count = 0; while(co…… 题解列表 2024年12月30日 1 点赞 0 评论 1258 浏览 评分:10.0