剪格子(DFS+回溯+剪枝) ```cpp#include#includeusingnamespacestd;intn,m;intmaze[10][10];intvis[10][10];intdx[4]={1,0,-1,0};intdy[4]={0,-1,0,1};intsum=0, 题解列表 2022年01月27日 0 点赞 1 评论 1098 浏览 评分:9.9
按部就班--计算器 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int a, b; char op; doub…… 题解列表 2022年01月27日 0 点赞 0 评论 633 浏览 评分:9.9
[STL训练]Let the Balloon Rise java语言 解题思路:我的解题思路是:先创建两个数组,一个为字符串型数组,另一个为整型数组。然后进行双重for循环,设置i和j变量(你也可以理解为C语言中的指针),后面的我就用指针来解释啦~(即使java中没有指针),i(指针)先指至字符串首位置,让j(指针)去一个一个的判断是否与i(指针)指向的元素是否相等, 题解列表 2022年01月27日 0 点赞 0 评论 754 浏览 评分:9.9
优质题解 python-01背包 解题思路:①建立一个存放物品的n*2大小的数组commodities[n+1][2],commodities[i][0]表示第i个物品的重量,commodities[i][1]表示第i个物品的价值。②建立一个大小为m+1的数组dp[m+1],dp[i]表示背包剩余容量为m时,所能装载的最大价值。 题解列表 2022年01月27日 0 点赞 0 评论 1135 浏览 评分:9.9
1085: A+B for Input-Output Practice (I) 摘要:解题思路:这题其实谁都会做,主要是要看出题目里的要求:“with one line of output for each line in input”,也就是要用EOF来结束注意事项:输出时别忘记换行…… 题解列表 2022年01月27日 0 点赞 4 评论 1417 浏览 评分:9.9
划划水啦~~~ 摘要:解题思路:循环嵌套,规定步长注意事项:sum的归零参考代码:#include<stdio.h> int main() { int n; scanf("%d",&n); …… 题解列表 2022年01月27日 0 点赞 0 评论 1030 浏览 评分:9.9
有规律的数列求和(C语言代码) 摘要:####解题思路: ``` 2/1 + 2/3 + 5/3 + 5/8 + 13/8 + 21/13 + …… Sn = Y1/X1 + Y2/X2 + Y3/X3 + Y4/X4 + …… +…… 题解列表 2022年01月27日 0 点赞 0 评论 520 浏览 评分:9.9
顺便练习一下函数 摘要:#include<stdio.h> int fun(int n) { int ret; if ( n%2==0 ) { ret=n/2; printf("%d/2=%d\n…… 题解列表 2022年01月27日 0 点赞 0 评论 579 浏览 评分:9.9
编写题解 1131: C语言训练-斐波纳契数列 ```pythonl=[1,1]n=int(input())ifn==1:print(l[0])elifn==2:print('{}{}'.format(l[0],l[1]))else:foriinrange(2,n):s=l[i-1]+l[i-2]l.append(s)ifn>=3:foriinl: 题解列表 2022年01月27日 0 点赞 1 评论 598 浏览 评分:9.9
[编程入门]自定义函数之字符提取(c语言) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>int fun(char x[],char b[]){ int n,l,j=0; …… 题解列表 2022年01月27日 0 点赞 0 评论 548 浏览 评分:9.9