编写题解 1022: [编程入门]筛选N以内的素数 摘要:```c #include int main() { int num,i,j,n; scanf("%d",&num); for(n=2;n…… 题解列表 2024年06月04日 0 点赞 0 评论 180 浏览 评分:9.9
编写题解 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 评论 339 浏览 评分: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 评论 131 浏览 评分: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 评论 148 浏览 评分:0.0
占用内存较少,两个for循环搞定 摘要:解题思路:无注意事项:无参考代码:#include <stdio.h>//素数定义:只能被常数1或自己整除,不能被其他整数整除的正整数int main(){ int int_data = 0; …… 题解列表 2024年05月09日 0 点赞 0 评论 147 浏览 评分: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 评论 299 浏览 评分:0.0
【编程入门】筛选N以内的所有素数 摘要:解题思路:注意事项:参考代码:#include <stdio.h> int main() { int i,N,j,a; scanf("%d",&N); for(i=2…… 题解列表 2024年04月17日 0 点赞 0 评论 89 浏览 评分:0.0
1022: [编程入门]筛选N以内的素数 摘要:解题思路:注意事项:参考代码:import math N = int(input()) arr = [True] * (N + 1) for i in range(2, int(math.sqr…… 题解列表 2024年04月05日 0 点赞 0 评论 193 浏览 评分:0.0
筛选n以内的完数 c语言 摘要:解题思路:用两个for循环来做,第一个for循环用来从一到n,第二个for循环用来判断是不是素数如果取余为零则说明是因子注意事项:参考代码:#include <stdio.h>int main(){ …… 题解列表 2024年03月11日 0 点赞 0 评论 225 浏览 评分:9.9
N以内的素数 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n,i,j,count; scanf("%d",&n); for(i=1;i<n;i++) …… 题解列表 2024年03月09日 0 点赞 0 评论 147 浏览 评分:9.9