[Coursera]算法基础_Week9_考试_Q2
来源:互联网 发布:c语言经典编程题pdf 编辑:程序博客网 时间:2024/05/17 08:35
#include <iostream>#include <stdio.h>#include <stdlib.h>#include <set>#include <string.h>using namespace std;//int map[1025][1025];int ans[1025][1025];struct Point {int x;int y;int cl;Point(int x_,int y_,int cl_):x(x_),y(y_),cl(cl_){}};int F(int m, int n) {if (n > m) {int temp = m;m = n;n = temp;}if (m%n == 0)return n;else {return F(m%n, n);}}int main(){int M, N;while(cin >> M >> N) {cout << F(M, N) << endl;}return 0;}
0 0
- [Coursera]算法基础_Week9_考试_Q2
- [Coursera]算法基础_Week9_考试_Q1
- [Coursera]算法基础_Week9_考试_Q3
- [Coursera]算法基础_Week9_考试_Q4
- [Coursera]算法基础_Week9_考试_Q5
- [Coursera]算法基础_Week9_考试_Q6
- [Coursera]算法基础_Week9_考试_Q7
- [Coursera]算法基础_Week9_考试_Q10
- [Coursera]算法基础_Week2_枚举_Q2
- [Coursera]算法基础_Week3_递归_Q2
- [Coursera]算法基础_Week7_广搜_Q2
- [Coursera]算法基础_Week4_动态规划(1)_Q2
- [Coursera]算法基础_Week5_动态规划(2)_Q2
- [Coursera]算法基础_Week6_深搜(1)_Q2
- [Coursera]算法基础_Week8_二分与贪心_Q2
- [Coursera]数据结构基础_Week2_线性表_Q2
- [Coursera]数据结构基础_Week4_字符串_Q2
- [Coursera]数据结构基础_Week3_栈与队列_Q2
- 数组和指针
- 进击的KFC:UI(14)集合视图UICollectionView
- 递归读取heritrix 爬下来的目录文件
- StringBuffer类常用方法(Java)
- 前端小工具集合
- [Coursera]算法基础_Week9_考试_Q2
- 第4天
- IC分词和IK分词
- Java出现No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- Swift 柯里化(currying)和反柯里化(uncurrying)
- JSON转List
- 112Path Sum
- 扣丁学堂——收发短信
- leetcode -- Search a 2D Matrix II -- 重点要理解