错误探测(用一二维数组储存行和列里1的数量,再判断二维数组里的元素是否为偶数,定义两个变量存储需要变的元素的行和列坐标,再定义一个变量判断是否需要变元素) 摘要: 参考代码: ```c #include int main() { int n; scanf("%d",&n); int a[n][n]; int ranks[2…… 题解列表 2023年10月29日 0 点赞 0 评论 289 浏览 评分:0.0
最简单!最容易理解! 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int N,i,x=1; scanf("%d",&N); for(i=1;i<N;i++) { x=(x…… 题解列表 2023年10月29日 0 点赞 0 评论 343 浏览 评分:9.0
完数的判断代码记录 摘要:解题思路:1.第一次用数组储存因子,无效数字的因子也会添加到数组里,时间超限2.第二次放弃数组,老老实实遍历注意事项:参考代码:用数组的代码,用到了指针,定义数组长度与输入数字相等#include<s…… 题解列表 2023年10月29日 0 点赞 0 评论 374 浏览 评分:0.0
暴搜求扫雷游戏地雷数 摘要:首先看这道题的数据范围,明显比较小。所以我们可以直接考虑暴力。 我们可以遍历每一个点,然后分别搜索每个点周围的雷的数量,然后直接输出。 一下是这种方式的代码。 ```cpp #include …… 题解列表 2023年10月28日 0 点赞 0 评论 779 浏览 评分:9.9
1136: C语言训练-求具有abcd=(ab+cd)2性质的四位数 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int hou(int i){ int s; s=i%100; return s;}int qian(int i){ int s,h…… 题解列表 2023年10月28日 0 点赞 0 评论 364 浏览 评分:9.9
整数去重(两种方法) 摘要:第一种是直接去掉重复元素(跟之前去掉空格那个思路一样): 参考代码: ```c #include int main() { int n; scanf("%d",&n); int …… 题解列表 2023年10月28日 0 点赞 0 评论 513 浏览 评分:0.0
2330: 信息学奥赛一本通T1178-成绩排序 摘要:解题思路:注意事项:参考代码:#include<iostream> #include<bits/stdc++.h> using namespace std; struct dev { …… 题解列表 2023年10月28日 0 点赞 0 评论 547 浏览 评分:0.0
2329: 信息学奥赛一本通T1177-奇度单增序列 摘要:解题思路:注意事项:参考代码:#include<iostream> #include<bits/stdc++.h> using namespace std; int main() { …… 题解列表 2023年10月28日 0 点赞 0 评论 401 浏览 评分:0.0
判决素数个数(自定义函数) 摘要:解题思路:在主函数里调用自定义的函数参考代码:#include<iostream>using namespace std;void pss(int x,int y){ int s = 0; int i…… 题解列表 2023年10月28日 0 点赞 0 评论 420 浏览 评分:9.9
2853: 字符替换 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;char s[100000],a,b;int main(){ cin>>s;…… 题解列表 2023年10月28日 0 点赞 0 评论 268 浏览 评分:0.0