ZOJ 1003
来源:互联网 发布:a11仿生芯片知乎 编辑:程序博客网 时间:2024/05/22 00:45
judge函数是怎么执行的?求问
/*函数不是很懂??????*/#include<iostream>#include<stdio.h>#include<algorithm>using namespace std;bool atrue, btrue;int judge(int m, int n, int p){ if (atrue) return 0; if (m == 1 && n == 1) //均正确 { atrue = true; return 0; } if (n == 1) //如果b正确,即赢 { btrue = true; } while (p > 1) { if (m%p == 0) //p是m的因子 { judge(m / p, n, p - 1); } if (n%p == 0) //p是n的因子 { judge(m, n / p, p - 1); } p--; } return 0;}int main(){ int a, b; while (cin >> a >> b) { if (a < b) swap(a, b); atrue = false; btrue = false; judge(a, b, 100); if (!atrue&&btrue) cout << b << endl; else cout << a << endl; } return 0;}
阅读全文
0 0
- zoj 1003
- zoj-1003
- zoj-1003
- zoj 1003
- zoj 1003
- ZOJ 1003
- ZOJ 1003
- ZOJ 1003
- ZOJ 1003
- zju 1003 zoj 1003
- [ZOJ] 1003 Crashing Balloon
- zoj 1003 Crashing Balloon
- ZOJ 1003 Crashing Balloon
- zoj 1003 Crashing Balloon
- ZOJ 1003 Crashing Balloon
- zoj 1003 Crashing Balloon
- zoj 1003 Crashing Balloon
- zoj 1003 Crashing Balloon
- HDU4586 Play the Dice(数论)
- 第一章:开始
- C语言提高-36讲: 指针数组和数组指针的使用
- 坑爹!攻城狮老爸被苹果解雇 只因女儿晒iPhone X
- 2018 届互联网校招高薪清单曝光:25 万年薪只是白菜价?
- ZOJ 1003
- 集合
- kafka入门综合概要介绍
- Shell学习---1
- cmd中检测远程的ip和端口是否处于监听状态
- 解决“打开Excel文件时会同时打开一个名为Sheet1的未保存空白工作簿”的问题
- GitHub上优秀的Go开源项目(转载)
- ofbiz实战——管理员信息管理界面
- Hbase在HDFS上的目录树