![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
蓝桥杯历届真题
mzAGGy
(⌒-⌒; )
展开
-
第十一届蓝桥杯国赛C++B组
有空再写剩下的题 A.美丽的2 暴力杯的第一道暴力题 #include <bits/stdc++.h> using namespace std; bool sol(int a){ while(a){ int tmp=a%10; if(tmp==2)return true; a/=10; } return false; } int main(){ int res=0; for(int i=1;i<=2020;i++){ if(sol(i))res++; } c.原创 2021-05-24 17:06:05 · 102 阅读 · 0 评论 -
蓝桥杯c++组 凑算式
这个算式中 A ~ I 代表 1 ~ 9 的数字,不同的字母代表不同的数字。 比如: 6 + 8 / 3 + 952 / 714 就是一种解法, 5 + 3 / 1 + 972 / 486 是另一种解法。 这个算式一共有多少种解法? (网上已经有很多dfs或者next_permutation的解法了,这些解法对于新手来说不太友好,所以我写了一个纯暴力的做法,幼儿园的都能看明白 #include <iostream> using namespace std; int main(){ int.原创 2021-04-17 17:48:46 · 144 阅读 · 0 评论