蓝桥杯2014年第五届真题-兰顿蚂蚁-题解(C++代码) 思路简单 ####原题链接:[兰顿蚂蚁](https://www.dotcpp.com/oj/problem1429.html)####解题思路1.首先是数据的读取问题,用常量及数组即可,这里需要注意的是在读取字符的时候,需要使用getchar()来读取空格, 题解列表 2019年10月25日 0 点赞 1 评论 1773 浏览 评分:9.9
[编程入门]自定义函数处理最大公约数与最小公倍数 (C++代码) 摘要:#include #include #include using namespace std; int a(int n,int m) //求最大公因数的函数我叫他a { if(n>…… 题解列表 2019年10月25日 0 点赞 1 评论 2371 浏览 评分:9.9
[编程入门]结构体之时间设计-题解(C++代码)简单易懂哦! #includestructt{intyear;intmouth;intdate;};intf(structta);intmain(){structta;std::cin>>a.year>>a.mouth>>a.date;std::cout 题解列表 2019年10月24日 0 点赞 3 评论 1693 浏览 评分:9.4
明明的随机数-题解(C++代码)-----新手级别 摘要:#include #include using namespace std; int main() { int n; cin>>n; int a[n]; for(int i=0…… 题解列表 2019年10月23日 0 点赞 0 评论 1464 浏览 评分:9.9
只考虑对角线 1115题-DNA-题解(C++代码) ###因为数据范围较小我们只需要开一个矩阵,只考虑主对角线和次对角线就行了,除了第一行之外去掉第一行输出。```cpp#include#include#includeusingnamespacestd;intN;inta,b;ints[110][110];intmain(){cin>>N;while( 题解列表 2019年10月22日 0 点赞 0 评论 1259 浏览 评分:0.0
蓝桥杯基础练习VIP-龟兔赛跑预测-题解(C++代码) 这道题不需要添加时间作为变量,直接用乌龟行走的时间代替时间变量,会更加简便```cpp#includeusingnamespacestd;intmain(){inta=0,b=0,v1,v2,s,l,t;cin>>v1>>v2>>t>>s>>l;while(1){a+=v1;b+=v2;//一次各个加 题解列表 2019年10月22日 0 点赞 0 评论 1210 浏览 评分:9.9
蓝桥杯算法提高VIP-贪吃的大嘴-题解(参考背包九讲,多重背包问题) ```#include#includeusingnamespacestd;constintN=20010;intf[N];intmain(){intm,n,w,s;cin>>m>>n;fill(f+1,f+N,N);//f[0]为0,即无形中限定了美味度刚好等于m, 题解列表 2019年10月22日 0 点赞 1 评论 1730 浏览 评分:9.9
[编程入门]报数问题-题解(C++代码) 借用了一位大佬的思路,自己写了一下,仅为学习,让大家检查一下,看看有没有问题。或者有能优化的地方,欢迎指出。#include#includetypedefstructLnode{intdata;structLnode*next;}Lnode, 题解列表 2019年10月22日 0 点赞 0 评论 1393 浏览 评分:6.0
蓝桥杯算法提高VIP-和最大子序列-题解(C++代码) 摘要:``` #include using namespace std; int main(){ int n,t,s=0,maxn=-10010;//最小的数为-10000 cin>>n; …… 题解列表 2019年10月22日 0 点赞 1 评论 1098 浏览 评分:9.3
蛇行矩阵-题解(C++代码) **每一行的数都等于上一行相应位置的前一个,所以先写出第一行,并不断更新**```cpp#includeusingnamespacestd;intmain(){inta[110]={1};//初始化a[0]=1intn;cin>>n;cout 题解列表 2019年10月21日 0 点赞 0 评论 1578 浏览 评分:0.0