P1000 (C++代码) 摘要:解题思路:自然数可以整型表示注意事项:参考代码:#include<iostream>using namespace std;int main(){ int a,b; for(int i=0…… 题解列表 2018年10月09日 0 点赞 0 评论 708 浏览 评分:0.0
求解1038:本地测试符合要求,为啥说我答案错误呢? (C语言代码) 摘要:#include <stdio.h>#include <math.h>float s(float a,float b,float c){ float s; s=(a+b+c)/2; return s;…… 题解列表 2018年10月09日 0 点赞 0 评论 553 浏览 评分:0.0
这条题目比较简单,没什么难的 摘要:解题思路:取模就行了注意事项:参考代码:#include<stdio.h>int fun(int *a ,int *b){ int i,hour=0,min=0,sec=0,temp1,temp…… 题解列表 2018年10月09日 0 点赞 0 评论 669 浏览 评分:0.0
C语言程序设计教程(第三版)课后习题7.4 (C++代码) 摘要:解题思路:首先,思考给出的九个数的排列有什么规律(从小到大 从大到小); 其次,在数组中插入数。注意事项:1.数组的定义注意避免溢出; 2.插入…… 题解列表 2018年10月09日 1 点赞 0 评论 655 浏览 评分:0.0
用筛法求之N内的素数。 (C语言代码) 摘要:解题思路:使用了普通筛选法和线性筛选法。两者的时间复杂度不一样。参考代码:普通筛选法:时间复杂度是O(nloglogn),不足之处在于一个合数可能被筛选多次。#include <stdio.h> #…… 题解列表 2018年10月09日 0 点赞 0 评论 890 浏览 评分:0.0
蓝桥杯算法提高VIP-寻找三位数 (C++代码) 摘要:解题思路:使用全排列函数next_permutation()很容易实现。参考代码:#include<bits/stdc++.h> using namespace std; const int N=…… 题解列表 2018年10月10日 0 点赞 0 评论 541 浏览 评分:0.0
蓝桥杯算法训练VIP-阶乘 (C++代码) 摘要:解题思路: 去掉每一次求解的阶乘后面的0,然后保留非0的后三位即可。不能只保留1位哦。参考代码:#include<bits/stdc++.h> using namespace std; int m…… 题解列表 2018年10月10日 1 点赞 0 评论 633 浏览 评分:0.0
C语言程序设计教程(第三版)课后习题6.11 (C语言代码) 摘要:解题思路:因为只涉及到平方根,所以可以直接使用开平方函数sqrt()注意事项:参考代码:#include <stdio.h>#include <math.h>int main(){ int n;…… 题解列表 2018年10月10日 0 点赞 0 评论 570 浏览 评分:0.0
蓝桥杯历届试题-回文数字 (Java代码) 摘要:解题思路: 五个位置/六个位置 回文数字(以5位数为例) 位置1的数字=位置5 位置2的数字=位置4 位置3 依次将数字0~9插入 注意位置1不能插入0注意事项:参考代码:pub…… 题解列表 2018年10月10日 0 点赞 0 评论 770 浏览 评分:0.0
P1001 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<vector>#include<algorithm>using namespace std;void is_prim…… 题解列表 2018年10月10日 0 点赞 0 评论 589 浏览 评分:0.0