P1001 (C语言代码) 摘要:解题思路:用 sort 函数对输入的数进行排序; 将得到的数进行判断是否为一个素数;注意事项:参考代码:#include<iostream>#include<algorith…… 题解列表 2018年11月30日 2 点赞 2 评论 335 浏览 评分:0.0
P1001 (C++代码) 摘要:解题思路: 用sort函数先排序,然后求出第k大的数字减去第k小的数字的值m,再判断m是否是素数即可。参考代码:#include <bits/stdc++.h> using namespace …… 题解列表 2018年12月01日 0 点赞 0 评论 441 浏览 评分:0.0
P1001 (C语言代码) 摘要:解题思路: 本来想用快速排序法的,可是时间超时了,有大佬解释一下吗?注意事项:参考代码:#include <stdio.h> #include <string.h> int a[10…… 题解列表 2019年01月21日 0 点赞 0 评论 604 浏览 评分:0.0
P1001 (C语言代码) 摘要:解题思路: 获取最大值 - 获取最小值 ,直接判断注意事项: 注意排好序 参考代码:#include<stdio.h>int isprime(int k) …… 题解列表 2019年02月03日 2 点赞 1 评论 226 浏览 评分:0.0
P1001 (C语言代码)这题小于2输出NO,我哭了 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ int a[10000]; int i,j,m,n; scanf("%d%d",…… 题解列表 2019年03月07日 0 点赞 0 评论 457 浏览 评分:0.0
P1001 (C++代码)水一下 摘要:解题思路: 又水了一发啊参考代码:#include<bits/stdc++.h> #define hh ios::sync_with_stdio(false),cin.tie(0),cout.…… 题解列表 2019年04月17日 0 点赞 0 评论 358 浏览 评分:0.0
P1001 (C语言代码) 摘要:解题思路:注意事项:素数<2情况不能忽略,报错n次没发现问题。参考代码:#include<stdio.h>#include<math.h>int isprime(int num){ int i; if…… 题解列表 2019年06月03日 0 点赞 0 评论 538 浏览 评分:0.0
P1001-题解(C++代码) 摘要:这个题分为两个部分 部分一 先对数组进行排序 找到第k大和第k小 并且计算其差值m 部分二 对m进行素数判定 是的话返回true 否则返回false 最后按照题目条件输出即可 …… 题解列表 2019年08月29日 0 点赞 0 评论 555 浏览 评分:0.0
P1001-题解(C语言代码) 摘要:#include #include #include #include int main() { long n,k; long x[10000]; long a,b,c,d; …… 题解列表 2019年08月29日 0 点赞 0 评论 600 浏览 评分:0.0
P1001-题解(C语言代码) 摘要:1、我解决这道题的思路是:首先输入的数字序列按从小到大的顺序排序,再取出第K最大和最第K最小的数字计算Result,之后判断Result是否是质数。 2、参考代码如下: #include …… 题解列表 2020年02月17日 0 点赞 0 评论 566 浏览 评分:0.0