编写题解 1062: 二级C语言-公约公倍 摘要:解题思路:注意事项:参考代码:#include<stdio.h> int main() { int m = 0, n = 0, i = 1; int x = 0, y = 0; i…… 题解列表 2022年07月30日 0 点赞 0 评论 426 浏览 评分:0.0
用set去重并排序 摘要:解题思路:通过set关联容器,set中每个元素都唯一,且能根据元素的值自动排序。注意事项:参考代码:#include <bits/stdc++.h> //万能头文件 using namespace …… 题解列表 2022年07月30日 0 点赞 0 评论 435 浏览 评分:0.0
2240: 蓝桥杯算法训练-删除数组零元素(注意原数组元素全为0怎么办) 摘要:解题思路:注意事项:关键在于数组里面元素全为0的时候怎么处理参#include<stdio.h>int num[1000]={};int CompactIntegers(int n,int a[100…… 题解列表 2022年07月30日 0 点赞 0 评论 482 浏览 评分:0.0
单元素插入数组问题 摘要:解题思路: 由于本题元素个数较少,我们不妨对插入后的数组调用sort()函数进行排序操作,从而直接输出该数组(最简单的一种方法,易于操作)注意事项: sort函数的头文件为#include<algor…… 题解列表 2022年07月30日 0 点赞 0 评论 277 浏览 评分:0.0
信息学奥赛一本通T1267-01背包问题(动态规划) 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int w[31];int c[31];int dp[201] = {0};int main(…… 题解列表 2022年07月31日 0 点赞 0 评论 434 浏览 评分:0.0
不知道为什么用python有一组数据n=12不通过,求大佬教教 摘要:解题思路:注意事项:参考代码:n = int(input())t = 0for i in range(1, n + 1): t += 1 / iprint("%.6f"%t)…… 题解列表 2022年07月31日 0 点赞 2 评论 573 浏览 评分:0.0
十进制转八进制(递归解法) 摘要:解题思路:递归注意事项:参考代码:#include <stdio.h>void f(int n){ int r; r = n % 8; if(n >= 8) …… 题解列表 2022年07月31日 0 点赞 0 评论 463 浏览 评分:0.0
公约公倍(辗转相除法) 摘要:解题思路:最大公约数用辗转相除,最小公倍数为两数之积除以最小公倍数注意事项:参考代码:#include<stdio.h>int a(int m,int n){ return (m%n==0)?n…… 题解列表 2022年07月31日 0 点赞 0 评论 301 浏览 评分:0.0
[编程入门]三个字符串的排序:不断strcpy 摘要:解题思路:类比a,b,c三个数比较大小注意事项:字符串内置函数的使用方法参考代码:#include<stdio.h>#include<string.h>int main(){ char a[100],…… 题解列表 2022年07月31日 0 点赞 0 评论 435 浏览 评分:0.0
题解 1125: C语言训练-委派任务* 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(void){ int i; int a[6]={0}; for(a[0]=0;a[0]<2;a[0]++) for(…… 题解列表 2022年07月31日 0 点赞 0 评论 355 浏览 评分:0.0