题解列表

筛选

C语言训练-阶乘和数*

摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; const int N = 10; int a[N]; int main() {……

1157题解(C语言)

```c#include//函数yue_shu用于计算一个整数n的所有真约数(除了它本身)的和intyue_shu(intn){intsum=0;//初始化sum变量用于累加约数//遍历所有可能的约数i,从1到n/2(因为超过n/2的数不可能是n的约数)for(inti=1;i

1162: 密码(遍历)

摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; int main() { int m,cnt = 0; string s, ……

简单易懂(c语言代码)

```c#include#includeintmain(){intn;//用于存储测试用例的数量intsign[4];//用于标记密码中包含的不同字符类别的数量//从标准输入读取测试用例数量scanf("%d",&n);getchar();//读取并丢弃换行符//循环处理每个测试用例for(inti=

python--study||O.o

摘要:参考代码: def main():     n = int(input())     arr = [int(x) for x in input().split()]     find = in……

python--study||O.o

摘要:参考代码: def main():     n = int(input())     t = dict()     mx = -1     for i in range(n):     &nb

1163: 排队买票()

摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; const int N = 11; long long a[N]; //计算卡特兰……

简单递归算法

解题思路:根据题目要求,大母牛每年生一头小母牛,小母牛在第四个年头开始生一头小母牛;观察题例,第二年是2头,第四年是4头,第五年为6头,说明第2年母牛才生的第一头小母牛,(用手指头算算是不是第二年到第五年刚好满4年)。由此我们可以画树状图分析由图我们得知规律第n年1234567F(n)头1234691

python解题方式

摘要:解题思路:注意事项:参考代码:a = []while len(a) < 12:    a.append(float(input()))b = sum(a)/12print(&#39;$%.2f&#39……