hdu2104 辗转相除法
来源:互联网 发布:苏小红c语言第三版pdf 编辑:程序博客网 时间:2024/06/07 00:08
分析:用基本的辗转相除法
/** Filename: code.cpp* Created: 2017-10-10* Author: wyl6 *[mail:17744454343@163.com]* Desciption: Desciption*/#include <cstdio>#include <cstdlib>#include <iostream>#include <stack>#include <queue>#include <algorithm>#include <cstring>#include <string>#include <cmath>#include <vector>#include <bitset>#include <list>#include <sstream>#include <set>#include <functional>using namespace std;#define INF 0x3f3f3f3f#define MAX 100typedef long long ll;int n,m;int gcd(int a,int b){if(b == 0) return a;else return(gcd(b,a%b));}int main(int argc, char const* argv[]){//#ifndef ONLINE_JUDGE// freopen("in.txt", "r", stdin);// freopen("out.txt", "w", stdout);//#endifwhile (cin >> n >> m){if(n == -1) break;if(gcd(n,m) == 1) printf("YES\n");else printf("POOR Haha\n");}return 0;}
阅读全文
0 0
- hdu2104 辗转相除法
- 辗转相除法
- 辗转相除法
- 辗转相除法
- 辗转相除法
- 辗转相除法
- 辗转相除法
- 辗转相除法 最大公约数
- 辗转相除法
- 辗转相除法
- 辗转相除法
- 辗转相除法
- 辗转相除法
- 温习辗转相除法
- 辗转相除法
- 辗转相除法
- 辗转相除法
- 证明辗转相除法
- kubernetes的ceph RBD volume(5): 创建动态的volume绑定随replica scale的扩容和缩容的pod
- Linux系统的内核态和用户态
- Java(1):方法重载(1)
- 原生JS获取和设置指定属性
- OpenStack Tacker介绍
- hdu2104 辗转相除法
- 看完让你彻底搞懂Websocket原理
- 辗转相除法求两个非负数的最大公约数问题
- MVVM 框架结构
- 【安全牛学习笔记】离线密码破解
- Vuejs组件——slot内容分发
- 2017做到的笔试题及答案
- [LeetCode] 404.Sum of Left Leaves
- 插件编写注意规则