题解列表

筛选

信息学奥赛一本通T1181-整数奇偶排序

摘要:解题思路:通过设置3个数组,用for循环分别录入,计算相应奇偶数数量,输出。使用冒泡法进行排序。注意事项:参考代码:#include <stdio.h>int main(){    int a[10]……

c语言代码解决问题

摘要:解题思路:1. 使用哈希表:可以使用哈希表来存储数组元素及其对应的索引,以减少查找的时间复杂度。在内层循环中,可以通过查询哈希表来找到与当前元素配对的另一个元素,而不需要遍历整个数组。2.排序数组:如……

c语言代码解决问题

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){    int n,num;    float consume = 0;    scanf("%d", &n); ……

图·一乐

摘要:解题思路:注意事项:纯属享受sort的便利参考代码:#include<iostream>#include<algorithm>using namespace std;int main(){    in……

更适合c++的奇偶排序

摘要:解题思路:两个数组,一个存储,一个变化注意事项:参考代码:#include <iostream>#include <algorithm>using namespace std;int main() {……

图一·乐5

摘要:解题思路:注意事项:参考代码:#include#includeusing namespace std;int main(){    int n;    cin >> n;    int arr[100……

c语言代码解决问题

摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<stdlib.h>#include<string.h>struct people{    char sex[7];  ……

1329: 合并傻子

摘要:```cpp #include #include int max(int a,int b) { return a>b?a:b; } int min(int a,int b) {……

1331: 新三国争霸

摘要:```cpp #include #include using namespace std; int n,m,t,v,k,x,y,p,k1,k2,fa[301],f[51],d[51][51];……

小学生解法,刚学一周C,不会太复杂的

摘要:解题思路:将两行字符串相同的部分去除,剩下的两行字符串,哪个的字符数多,就以哪行的字符串数为操作次数(哈哈自己推下为什么)然后通过for循环比较a[i]b[i],要分开依次寻找出现重复的字符,统计su……