题解列表

筛选

优质题解

迷宫问题 (C语言代码)

摘要:解题思路:    第一次写,理理思路。    1、采用广度优先搜索,先让起点入队;    2、队列首端出队,将下一步可达位置入队,并标记距离为上一步的距离 + 1;    3、当队列不为空时循环2过程……

三位数反转 (C语言代码)

摘要:解题思路:    循环分离各位数。参考代码:#include<stdio.h> int main() {     int i, n, a[3] = {0};          while……

【出圈】 (C++代码)

摘要:解题思路:f[1]=0;f[i]=(f[i-1]+m)%i; (i>1)注意事项:参考代码:#include<iostream>#include<algorithm>using namespace s……

【偶数求和】 (C++代码)

摘要:解题思路:主要分为m能否被n除尽两种情况;注意事项:参考代码:#include <iostream>using namespace std;int main(){ int n, m,i,s=0,a,j……