![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
递归
文章平均质量分 60
sysu安仔
这个作者很懒,什么都没留下…
展开
-
递归求最大公约数
#include "iostream" #include "cmath" using namespace std; //一个数和0的最大公约数就是这个数本身 //a / b = q + r => gcd(a,b) = gcd(b,r) int gcd(int a, int b){ int r = a % b; //余数 int q = a / b; //商'''''' if (r == 0)原创 2014-11-18 11:19:31 · 863 阅读 · 0 评论 -
sicily 1155 Can i post the letter
#include "iostream" #include "memory.h" using namespace std; const int MAX = 200; int road[MAX][MAX]; //标记路 bool isvisited[MAX]; //标记是否走过 int n, m; bool flag; //标记是否能到达 //深度优先遍历 void dfs(int current原创 2014-12-08 19:54:48 · 1059 阅读 · 0 评论