基于c++string特性的解法,但在vs上测试无问题,在网页验证过不去 摘要:解题思路:利用c++本身的string 的特性,来完成解答c++对于string字符串是允许直接对字符串本身进行用 [ ] 的方式来访问字符串中的 单个字符,因此,我们只需通过string库内自带的…… 题解列表 2024年11月05日 1 点赞 1 评论 393 浏览 评分:9.9
高精度加法 摘要:#include"bits/stdc++.h" using namespace std; int main(){ string a1,a2; int b1[20000],b2[…… 题解列表 2024年11月05日 0 点赞 0 评论 220 浏览 评分:0.0
详细注释 2046: 输出全排列 摘要:``` #include #include #include #include #include #include #include #include #include #incl…… 题解列表 2024年11月05日 2 点赞 0 评论 298 浏览 评分:8.0
C++[竞赛入门]简单的a+b题解 摘要:题目答案: ```cpp #include using namespace std; int main() { int a,b; while(cin>>a>>b)cout…… 题解列表 2024年11月04日 0 点赞 0 评论 594 浏览 评分:0.0
蓝桥杯2015年第六届真题-生命之树 树形dp 摘要: #include using namespace std; typedef long long ll; const int N=100010,M=2*N; …… 题解列表 2024年11月04日 0 点赞 0 评论 324 浏览 评分:9.9
详细解释 2842: 大整数减法 摘要:## 高精度减 高精度减会比较麻烦,需要考虑更多的因素 主要是考虑到负数的处理问题 为了方便,在进行运算之前,我们要先判断哪个数字是较大的那个 ```c++ bool cmp…… 题解列表 2024年11月04日 0 点赞 0 评论 462 浏览 评分:0.0
详细解释 2841: 大整数加法 摘要:## 高精度加 会超出long long 运算类型的运算使用传统的方法无法计算 此时此刻就需要使用高精度运算进行这种大整数的运算 ```c++ string s1,s2; cin…… 题解列表 2024年11月04日 0 点赞 0 评论 407 浏览 评分:0.0
C++容器秒了 摘要:解题思路:c++用容器写简单粗暴,输入的n表示换行次数,用一个COUNT表示已经输入的换行次数,这跟单例的计数(忘了具体叫什么名字了)比较像然后用<algorithm>里面的sort函数来进行从小到大…… 题解列表 2024年11月04日 0 点赞 0 评论 323 浏览 评分:0.0
2860: 字符串判等 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){string s,snew;getline(cin,s);f…… 题解列表 2024年11月03日 0 点赞 0 评论 289 浏览 评分:0.0
熟练使用STL容器,尽量多使用STL容器 摘要:解题思路: - 用vector容器将所有老年人(age>=60)筛出,然后排序,排序的话要使用stable_sort,它会在排序过程保持相等元素的原来的顺序 - 用vector存老年人要在里套一个…… 题解列表 2024年11月03日 0 点赞 0 评论 325 浏览 评分:0.0