十进制转八进制(递归解法) 摘要:解题思路:递归注意事项:参考代码:#include <stdio.h>void f(int n){ int r; r = n % 8; if(n >= 8) …… 题解列表 2022年07月31日 0 点赞 0 评论 512 浏览 评分:0.0
公约公倍(辗转相除法) 摘要:解题思路:最大公约数用辗转相除,最小公倍数为两数之积除以最小公倍数注意事项:参考代码:#include<stdio.h>int a(int m,int n){ return (m%n==0)?n…… 题解列表 2022年07月31日 0 点赞 0 评论 334 浏览 评分:0.0
信息学奥赛一本通T1422-活动安排(贪心算法) 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;struct Node{ int x, y;}I[1005];int cmp(…… 题解列表 2022年07月31日 0 点赞 0 评论 858 浏览 评分:2.0
[编程入门]三个字符串的排序:不断strcpy 摘要:解题思路:类比a,b,c三个数比较大小注意事项:字符串内置函数的使用方法参考代码:#include<stdio.h>#include<string.h>int main(){ char a[100],…… 题解列表 2022年07月31日 0 点赞 0 评论 479 浏览 评分: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 评论 381 浏览 评分:0.0
信息学奥赛一本通T1582-周年纪念晚会(树形DP) 摘要:解题思路:注意事项:参考代码:#include <iostream>#include <vector>using namespace std; const int MAXN = 6010;int dp…… 题解列表 2022年07月31日 0 点赞 0 评论 446 浏览 评分:9.9
信息学奥赛一本通T1268-完全背包问题(C++) 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int w[31];int c[31];int dp[201] = {0};int main(…… 题解列表 2022年07月31日 0 点赞 0 评论 349 浏览 评分: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 评论 494 浏览 评分:0.0
[编程入门]自定义函数求一元二次方程 写平常的三个函数(有点复杂,但思路比较清晰,利于新手,如有疏忽请多多指正!!!) 摘要:解题思路:写三个函数输出大于0,小于0和等于0的情况,为了简化代码可以不需要返回值,直接输出就行。一元二次方程的概念如下:一般式:ax²+bx+c=0(a≠0)。求根公式:利用一元二次方程根的判别式可…… 题解列表 2022年07月31日 0 点赞 0 评论 441 浏览 评分:9.9
1157: 亲和数 摘要:解题思路: ①在while 循环外 规定计数变量初值h, 在while循环内 将变量h++(每输入一次A,B),直至变量h>=M(结束输入A,B的值) ②…… 题解列表 2022年07月31日 0 点赞 0 评论 485 浏览 评分:0.0