[POJ]2301 Beat the Spread!
来源:互联网 发布:怎样关闭淘宝退款申请 编辑:程序博客网 时间:2024/06/06 08:26
题目非常简单,总结起来就是以下两点。
1、当a<b或者(a+b)%2==1的时候输出impossible。
2、其它情况输出 (a+b)/2 和 (a-b)/2
PS:一开始题目看错,害得我WA了两次。= =英文不好,太吃亏了。
//By:一只大幽灵//Time:2012/4/11#include <iostream>using namespace std;int main() { int n, a, b; cin >> n; for (int i = 0; i < n; i++) { cin >> a >> b; if (a < b || ((a + b) % 2 == 1))cout << "impossible" << endl; else cout << (a + b) / 2 << ' ' << (a - b) / 2 << endl; } return 0;}
- POJ 2301 Beat the Spread!
- [POJ]2301 Beat the Spread!
- poj 2301 Beat the Spread!
- poj 2301 Beat the Spread!
- Beat the Spread! POJ
- POJ 2301 Beat the Spread! G++
- POJ 2301 Beat the Spread <水题>
- POJ 2301 && HDU 1194 Beat the Spread!(水~)
- Beat the Spread!
- Beat the Spread! (P2301)
- zoj2388----------------Beat the Spread!
- HDU1194:Beat the Spread!
- 10812 - Beat the Spread!
- zoj_2388 Beat the Spread!
- hdu1194-Beat the Spread!
- zoj Beat the Spread!
- zoj2388 Beat the Spread!
- Beat the Spread!
- hdoj1241
- VC6.0里面怎么恢复默认的窗口
- 百度搜索引擎中文分词的三点原理
- this指针用法
- 区别C#中的两个属性(Property和Attribute)
- [POJ]2301 Beat the Spread!
- linux虚拟机VMware vSphere上安装VMware Tools
- Android下增加APK访问/data目录权限的方法
- centos No package 'glib-2.0' found解决办法
- Ibatis 实现多对多映射
- 数字图像处理基本算法实现(1)--section3.2基本灰度变换
- .net framework 知识点
- windows form (窗体) 之间传值小结
- JAVA中int、String的类型转换