题解列表

筛选

[编程入门]筛选N以内的素数-题解(python代码)

摘要:解题思路:    素数即只有1和它本身两个因子,显然,若数x在(2,根号X)内没有因子,则它在(根号X,x-1)内没有因子,为减少循环(但此题不容易超时,所以可以不用减少循环),计算在(2, int(……

蓝桥杯历届试题-回文数字 (暴力查找)C++代码。

摘要:解题思路:  在main()函数里输入N,和循环查找,在AA()函数中判断是否为回文数字,在BB()函数中判断,某个数字的所有位的和,是否等于输入的数字N;设置一个计数变量看是否没有满足条件的,输出:……

python-矩阵加法

摘要:解题思路:注意事项:注意题目要求最后一行不要有多余空格参考代码:def f(n,m):       A = [[int(j) for j in input().strip().split()] fo……

2190: Little Ke's problem

摘要:解题思路:注意事项:参考代码:n = input() print(f"What is your name? Hello {n}, nice to meet you.")……

2189: diamond(python代码)

摘要:解题思路:注意事项:参考代码:n = int(input()) m = 1 for i in range(n//2):     print(' '*((n-m)//2)+&#39……

A+B for Input-Output Practice (V)

摘要:解题思路:两层for循环,用数组存储相加所需数字注意事项:参考代码:#include<iostream>using namespace std;int main(){ int row, n;//row……