题解列表
从大到小的顺序输出其中前m大的数
摘要:解题思路:注意事项:参考代码:n,m = map(int,input().split())L = list(map(int,input().split()))L.sort(reverse = True……
编写题解 1046: [编程入门]自定义函数之数字后移 适合新手
摘要:解题思路:定义两个数组,一个用来接收改变后的排序,(m+i)%n 这个是核心 保证数组末尾的下一位是首位!!!注意事项:参考代码:#include<iostream>#include<cstri……
循环求和,一种简单的方法实现
摘要:解题思路:若 n = 5,设 变量 a = 0可推:2 = 2 x 1; (a)22 = 2 x 10 + 2 ( a = 2 * 10 + a)222 = 2 x 100 + 22 ( a = 2 ……
亲和数(python代码)
摘要:def cal(x):
total = 0
for i in range(1,x):
if x%i==0:
&nb
编写题解 1050: [编程入门]结构体之成绩记录 新手向 有问必回
摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cstring>using namespace std;struct student { string number……
编写题解 1051: [编程入门]结构体之成绩统计2 适合新手 有问必答
摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cstring>using namespace std;struct student { string number……
学生能看懂的c++语言
摘要:解题思路:难点在于如何用计算机模拟人一次次选的过程.有n个人,我们就定义一个长度为n个的数组a[n]不妨将m个元素赋1,其他元素初始化0。用一个for循环一次次地访问这个数组,当m次时,将a[i]赋0……