UVA839 - Not so Mobile
来源:互联网 发布:淘宝买家秀福利搜什么 编辑:程序博客网 时间:2024/05/16 11:04
题目较为简单,不做多余解释,递归函数的简单应用
代码如下:
#include <iostream>using namespace std;int cacult(int &qual){ int w1, d1, w2, d2, temp; if(cin>>w1>>d1>>w2>>d2 == 0)return -1; if(!w1) w1 = cacult(temp); if(!w2) w2 = cacult(temp); if(w1*d1 == w2*d2&&temp)qual = 1; else qual = 0; return w1+w2;}int main (){ int temp, n; cin>>n; while(n--) { if(cacult(temp) == -1)break; if(temp)cout<<"YES"<<endl; else cout<<"NO"<<endl; if(n)cout<<endl; } return 0;}
- UVA839 - Not so Mobile
- UVA839 - Not so Mobile
- UVa839 Not so Mobile
- uva839 not so mobile
- UVA839 - Not so Mobile
- uva839 Not so Mobile
- UVa839-Not So Mobile
- UVa839-Not so Mobile (天平)
- Not so Mobile 天平 UVA839
- uva839 Not so Mobile 递归
- uva839 Not so Mobile (重建二叉树)
- UVA839 Not so Mobile【二叉树】【递归】
- Uva839——Not so Mobile
- Uva839 Not so Mobile(天平)
- 【DFS】UVa839 天平(Not so Mobile)
- 例题6-9 UVa839 Not so Mobile(树)
- uva839-Not so Mobile-二叉树的DFS
- Uva839 Not so Mobile 【递归输入】【例题6-9】
- 判断两个单链表是否相交
- 在WinMain中嵌Console窗口
- vs2010调试DLL【c\c++】
- 如何查看eclipse版本号
- 通过RelativeLayout.LayoutParams.addRule()方法在代码中设置RelativeLayout相关属性
- UVA839 - Not so Mobile
- C#中的代理(Delegate)
- C++中IO操作符和赋值操作符的结合性
- 关于老外程序员的看法
- 输出一个字符串的大写英文字母数,小写英文字母数即非英文字母数--java
- VC++中使用ADO方式操作ACCESS数据库
- Linux文件IO编程
- Linux防火墙基础知识
- 应用MFC框架显示OSG