题解列表

筛选

筛选N以内的所有素数

摘要:解题思路:枚举每一个数字,判断是否为素数。注意事项:0和1要做特殊判断它们是非素数参考代码:#include<stdio.h>int Is_Prime(int n){    int i;    if(……

注意:两次相加

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){    int n;    scanf("%d",&n);    int sn=0,a=2,aa=0;    fo……

不要想太多,这样简单

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int max(int a,int b){    int s;    s=a%b;    while(s!=0)    {       ……

1229基础解法(Python)

摘要:解题思路:直接调用Python的math库函数即可注意事项:Python 3.9 以上版本可以直接调用math.lcm()函数,其他版本只有math.gcd()函数参考代码:from math imp……

1014: [编程入门]阶乘求和

摘要:解题思路:注意事项:参考代码:n = int(input()) a, b = 1, 0 for i in range(1,n+1):     a *= i; b += a print(b)……