用筛法求之N内的素数。 (C语言代码) 摘要:解题思路:使用了普通筛选法和线性筛选法。两者的时间复杂度不一样。参考代码:普通筛选法:时间复杂度是O(nloglogn),不足之处在于一个合数可能被筛选多次。#include <stdio.h> #…… 题解列表 2018年10月09日 0 点赞 0 评论 1322 浏览 评分:0.0
蓝桥杯算法提高VIP-寻找三位数 (C++代码) 摘要:解题思路:使用全排列函数next_permutation()很容易实现。参考代码:#include<bits/stdc++.h> using namespace std; const int N=…… 题解列表 2018年10月10日 0 点赞 0 评论 1081 浏览 评分:0.0
蓝桥杯算法训练VIP-阶乘 (C++代码) 摘要:解题思路: 去掉每一次求解的阶乘后面的0,然后保留非0的后三位即可。不能只保留1位哦。参考代码:#include<bits/stdc++.h> using namespace std; int m…… 题解列表 2018年10月10日 1 点赞 0 评论 1220 浏览 评分:0.0
C语言程序设计教程(第三版)课后习题6.11 (C语言代码) 摘要:解题思路:因为只涉及到平方根,所以可以直接使用开平方函数sqrt()注意事项:参考代码:#include <stdio.h>#include <math.h>int main(){ int n;…… 题解列表 2018年10月10日 0 点赞 0 评论 1052 浏览 评分:0.0
蓝桥杯历届试题-回文数字 (Java代码) 摘要:解题思路: 五个位置/六个位置 回文数字(以5位数为例) 位置1的数字=位置5 位置2的数字=位置4 位置3 依次将数字0~9插入 注意位置1不能插入0注意事项:参考代码:pub…… 题解列表 2018年10月10日 0 点赞 0 评论 1142 浏览 评分:0.0
P1001 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<vector>#include<algorithm>using namespace std;void is_prim…… 题解列表 2018年10月10日 0 点赞 0 评论 1036 浏览 评分:0.0
蓝桥杯算法提高VIP-质因数 (C语言代码) 摘要:解题思路:关键是最后一个数输出后没有*号,即不能每次输出因子后都输出*号。参考代码:#include <stdio.h> int main() { int n,i; scanf("%d",…… 题解列表 2018年10月10日 0 点赞 0 评论 1098 浏览 评分:0.0
C二级辅导-进制转换 (Java代码) 摘要:解题思路:注意事项:参考代码:package com.cx;import java.util.Scanner;public class Demo1055 { public static voi…… 题解列表 2018年10月10日 0 点赞 0 评论 1051 浏览 评分:0.0
C语言程序设计教程(第三版)课后习题5.7 (C语言代码) 摘要:解题思路:思路简单清晰注意事项:参考代码:#include<stdio.h>#include<math.h>int main() { int a,b=1,c,d=0,i=1,j,m; scanf("%…… 题解列表 2018年10月10日 0 点赞 0 评论 1154 浏览 评分:0.0
C语言程序设计教程(第三版)课后习题5.7 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main() { int a,b=1,c,d=0,i=1,j,m; scanf("%d",&a)…… 题解列表 2018年10月10日 0 点赞 0 评论 1026 浏览 评分:0.0