1022: [编程入门]筛选N以内的素数 摘要:解题思路:注意事项:参考代码:import math N = int(input()) arr = [True] * (N + 1) for i in range(2, int(math.sqr…… 题解列表 2024年04月05日 0 点赞 0 评论 131 浏览 评分:0.0
【编程入门】筛选N以内的所有素数 摘要:解题思路:注意事项:参考代码:#include <stdio.h> int main() { int i,N,j,a; scanf("%d",&N); for(i=2…… 题解列表 2024年04月17日 0 点赞 0 评论 64 浏览 评分:0.0
九行简便 编写题解 1022: [编程入门]筛选N以内的素数 摘要:解题思路:f=0,f=1注意事项:for i in range(2,n+1):参考代码:n=int(input())for i in range(2,n+1): f=0 for j in …… 题解列表 2024年04月17日 0 点赞 0 评论 99 浏览 评分:0.0
占用内存较少,两个for循环搞定 摘要:解题思路:无注意事项:无参考代码:#include <stdio.h>//素数定义:只能被常数1或自己整除,不能被其他整数整除的正整数int main(){ int int_data = 0; …… 题解列表 2024年05月09日 0 点赞 0 评论 118 浏览 评分:0.0
1022筛选N以内的素数 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int sushu(int n){ for(int i=2;i*i<=n;i++) { if(n%i==0)//不是素数 { …… 题解列表 2024年05月12日 0 点赞 0 评论 116 浏览 评分:0.0
编写题解 1022: [编程入门]筛选N以内的素数 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;bool ss(int n) { for(int i=2;i<n;i++) { …… 题解列表 2024年05月26日 0 点赞 0 评论 62 浏览 评分:0.0
编写题解 1022: [编程入门]筛选N以内的素数 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;bool qsh(int n) { for(int i=2;i<n;i++) {…… 题解列表 2024年05月30日 0 点赞 0 评论 130 浏览 评分:0.0
编写题解 1022: [编程入门]筛选N以内的素数 摘要:```c #include int main() { int num,i,j,n; scanf("%d",&num); for(n=2;n…… 题解列表 2024年06月04日 0 点赞 0 评论 129 浏览 评分:9.9
地板砖顶着地板砖 摘要:解题思路:无注意事项:无参考代码:n=input()n=int(n)b=0for i in range(2,n): b=0 for j in range(2,i): if i…… 题解列表 2024年07月17日 0 点赞 0 评论 170 浏览 评分:0.0
C语言求解素数(详解版) 摘要:解题思路:根据素数与合数的概念可以知道,素数是只能被1和它本身整除的数,而合数与之相反,是除了能被1和它本身整除之外,还能被其他因数整除。因此对于在一个范围内求素数,需要用到双循环结构,第一层循环用来…… 题解列表 2024年07月18日 0 点赞 0 评论 173 浏览 评分:0.0