题解列表
数值运用数组进行运算(C++)
摘要:解题思路:运用while循环进行判断,用for循环进行求和计算,运用数组来保存数值注意事项:当输入0时,停止计算参考代码:#include<bits/stdc++.h>using namespace ……
题解 1231: 杨辉三角
摘要:```cpp
#include
#include
using namespace std;
void generate(int numRows);
int main()
{
int……
1643: 蓝桥杯算法训练VIP-最大体积 完全背包问题变种
摘要:解题思路:类似完全背包问题,如果序列中的数不互质,那么就有无限多个。
> 证明:设序列$${a_i}$$中的数的最大公约数为k(k≠1),则可设
$$a_1b_1+a_2b_2+. ..+a_nb……
[竞赛入门]简单的a+b
摘要:解题思路:#include<iostream>using namespace std;int main(){ int a,b; while(cin>>a>>b) { cout……
1004: [递归]母牛的故事
摘要:解题思路:注意事项:参考代码:#include <iostream>using namespace std;int main(){ int n,r,a[100],num=0; int co……