python-数字三角形 摘要:解题思路:参考博客https://www.jianshu.com/p/99e379de3368动态规划。建立一个大小为(n+1)*(n+1)二维数组dp,其中dp[i][j]为从顶点走到到第i行第j列…… 题解列表 2022年02月09日 0 点赞 2 评论 655 浏览 评分:7.3
信息学奥赛一本通T1173-阶乘和 摘要:from math import factorial as f n=int(input()) s=0 for i in range(1,n+1): s+=f(i) print(s)p…… 题解列表 2022年02月10日 0 点赞 0 评论 548 浏览 评分:7.3
不同单词个数统计(熟悉一下set函数的用法) 摘要:```cpp #include #include #include using namespace std; string str; int sum=0; int main() { …… 题解列表 2022年02月11日 0 点赞 0 评论 479 浏览 评分:7.3
[编程入门]自定义函数之字符串连接,简单粗暴,通俗易懂。看一眼就懂 摘要:解题思路:前段时间看到大家对这题有争议,这次我来一无脑解法注意事项:注意把多于的0跳过参考代码:#include<stdio.h>#include<string.h>int main(){ cha…… 题解列表 2022年02月13日 0 点赞 0 评论 599 浏览 评分:7.3
1002: [编程入门]三个数最大值 摘要:解题思路:用max()函数求两数最大值,三个数最大值的话,使用两次max()就行了。注意事项:题目说要输入数组,但又指明三个数是a,b,c,感觉没表达清楚。参考代码:#include <iostrea…… 题解列表 2022年02月19日 0 点赞 2 评论 921 浏览 评分:7.3
信息学奥赛一本通T1317-组合的输出(格式错误的看过来!!!) 摘要:看important!!! ```cpp #include #include using namespace std; int* stack; int top; int n, r; i…… 题解列表 2022年02月21日 0 点赞 4 评论 1287 浏览 评分:7.3
[STL训练]美国大选 摘要:```cpp #include using namespace std; #include int main(){ int N; while((cin>>N)&&N!=0){ i…… 题解列表 2022年02月27日 0 点赞 0 评论 957 浏览 评分:7.3
用c++中string可以避免数据过大 摘要:解题思路:将输入的数据存入字符串类型的对象中,利用该对象自带的数组可以一个一个依次求和,注意将字符型转换为整型,“1”-“0”=1;即减去“0”即可。注意事项:参考代码:#include<iostre…… 题解列表 2022年03月03日 0 点赞 2 评论 491 浏览 评分:7.3
1045: [编程入门]自定义函数之整数处理 摘要:解题思路:处理数组的函数思路,遍历找最大值和最小值的位置,然后用swap()交换位置,其余没什么好说的。我的三个函数都是void型,即中间不需要返回值,直接在定义的数组里进行操作,最后打印数组即可。注…… 题解列表 2022年03月05日 0 点赞 0 评论 368 浏览 评分:7.3
if的运用比较简单,但是要注意格式 。 摘要:解题思路:if,分级注意事项:if后不加;小括号括起来条件,以防万一,最好加大括号。参考代码:#include<stdio.h>int main(){ int a; char A,B,C,D,…… 题解列表 2022年03月06日 0 点赞 1 评论 265 浏览 评分:7.3