2240: 蓝桥杯算法训练-删除数组零元素(注意原数组元素全为0怎么办) 摘要:解题思路:注意事项:关键在于数组里面元素全为0的时候怎么处理参#include<stdio.h>int num[1000]={};int CompactIntegers(int n,int a[100…… 题解列表 2022年07月30日 0 点赞 0 评论 516 浏览 评分:0.0
单元素插入数组问题 摘要:解题思路: 由于本题元素个数较少,我们不妨对插入后的数组调用sort()函数进行排序操作,从而直接输出该数组(最简单的一种方法,易于操作)注意事项: sort函数的头文件为#include<algor…… 题解列表 2022年07月30日 0 点赞 0 评论 314 浏览 评分: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 评论 467 浏览 评分: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 评论 612 浏览 评分:0.0
十进制转八进制(递归解法) 摘要:解题思路:递归注意事项:参考代码:#include <stdio.h>void f(int n){ int r; r = n % 8; if(n >= 8) …… 题解列表 2022年07月31日 0 点赞 0 评论 523 浏览 评分:0.0
公约公倍(辗转相除法) 摘要:解题思路:最大公约数用辗转相除,最小公倍数为两数之积除以最小公倍数注意事项:参考代码:#include<stdio.h>int a(int m,int n){ return (m%n==0)?n…… 题解列表 2022年07月31日 0 点赞 0 评论 338 浏览 评分:0.0
[编程入门]三个字符串的排序:不断strcpy 摘要:解题思路:类比a,b,c三个数比较大小注意事项:字符串内置函数的使用方法参考代码:#include<stdio.h>#include<string.h>int main(){ char a[100],…… 题解列表 2022年07月31日 0 点赞 0 评论 486 浏览 评分: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 评论 391 浏览 评分:0.0
信息学奥赛一本通T1268-完全背包问题(C++) 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int w[31];int c[31];int dp[201] = {0};int main(…… 题解列表 2022年07月31日 0 点赞 0 评论 358 浏览 评分:0.0
1142: C语言训练-立方和不等式(不用提示的算法,用减法实现) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(void){ int i; long long n; scanf("%lld",&n) ; for(i=1;;i++)…… 题解列表 2022年07月31日 0 点赞 0 评论 504 浏览 评分:0.0