
蓝桥杯
Drxx
https://kestory.github.io
展开
-
蓝桥杯 历届试题 PREV-1 核桃的数量
辗转相除法求最大公约数gcd再利用 gcd(a, b)*lcm(a, b) = a * b求得最小公倍数lcm#include <iostream>#define D(x) cout<<#x<<"="<<x<<endl;using namespace std;int gcd(int a, int b) { ...原创 2019-03-16 11:26:16 · 109 阅读 · 0 评论 -
蓝桥杯 历届试题 PREV-2 打印十字图
参考图:https://blog.youkuaiyun.com/jopus/article/details/19091643#include <iostream>#define D(x) cout<<#x<<"="<<x<<endl;using namespace std;int main() { int a;// = 3; cin...原创 2019-03-16 11:27:18 · 115 阅读 · 0 评论 -
蓝桥杯 历届试题 PREV-5 错误票据
#include <iostream>#include <algorithm>#include <vector>#define D(x) cout<<#x<<"="<<x<<endl;using namespace std;int main() { int line, x; ve原创 2019-03-16 11:28:01 · 142 阅读 · 0 评论 -
蓝桥杯 历届试题 PREV-6 翻硬币
#include <iostream>#include <string>#define D(x) cout<<#x<<"="<<x<<endl;using namespace std;int main() { string s1, s2; int result = 0; cin >> s1 >...原创 2019-03-24 16:44:02 · 139 阅读 · 0 评论 -
蓝桥杯 历届试题 PREV-8 买不到的数目
待:搞懂里面的数论知识&动归的方法数论:互质数的最大不能组合数#include <iostream>using namespace std;int main(int argc, char *argv[]) { int a, b; cin >> a >> b; cout << a*b - a - b;...原创 2019-03-24 16:46:18 · 178 阅读 · 0 评论 -
蓝桥杯 历届试题 PREV-21 回文数字
#include <iostream>using namespace std;#define D(x) cout<<#x<<"="<<x<<endl;int main(int argc, char *argv[]) { int n; cin >> n; bool flag; for (int i0 = 1; ...原创 2019-03-24 16:46:57 · 148 阅读 · 0 评论 -
蓝桥杯 历届试题 PREV-27 蚂蚁感冒
// 相遇后是否向相反方向可以看做两只蚂蚁擦肩而过/*--> lr --> rr cold<-- ll <-- rl*/#include <iostream>#include <cmath>using namespace std;int main(int argc, char *ar...原创 2019-03-24 16:47:57 · 132 阅读 · 0 评论