题解列表
奥运奖牌计数(C语言)
摘要:#include<stdio.h>
int main()
{
int n,sum1=0,sum2=0,sum3=0,sum,arr[50][3];
scanf("%d", &n);
……
用C语言解决母牛的故事[递归]
摘要:#### 解题思路:递归
题目的难点在于每年出生的母牛数量是不固定的,并且是每年都存在不固定数量的母牛加入生产母牛的行列。
#### 递归思路的体现:
先去考虑每年能够增加的母牛数量,再考虑这一……
两种解法哪种更优?还是?
摘要:直接for循环求解
```cpp
#include
#include
using namespace std;
int main()
{
int a,b;
for(int i=10……
<循环>阶乘求和(C语言)
摘要:解题思路:#include<stdio.h>
int main()
{
int n;
long long Sn=0, x = 1;
scanf("%d", &n);
for (in……
<循环>角谷猜想(C语言)
摘要:#include<stdio.h>
int main()
{
int n,x,y;
scanf("%d", &n);
while (n > 0)//未知循环次数用while语句
{……
<循环>整数的个数(C语言)
摘要:#include<stdio.h>
int main()
{
int k,arr[100],c1=0,c2=0,c3=0;
scanf("%d", &k);
for (int i = ……
python 字符串对比解法(ascll码值)
摘要:S1=input()S2=input()if len(S1)!=len(S2): print(1)else: a=0 b=0 c=0 for i in range(len……
2832: 第n小的质数 建立已知质数表用来比较,减小复杂度
摘要:解题思路:注意事项: 复杂度大约是 O(n*Π(n)) ?参考代码:#include <iostream>
// #include <sstream>
// #include <cstdio……
编写题解 1777: 循环练习之完美数判断(python)
摘要:解题思路:注意事项:参考代码:if __name__ == '__main__': n = int(input()) s = [] for i in range(1,……