zoj2388
来源:互联网 发布:nginx sticky 编辑:程序博客网 时间:2024/06/07 02:45
题目大意:
给出两个值得和以及差,求这两个值,大的在前,小的在后。
如果不可能,打印impossible。
解题思路:
水题一道
代码如下:
#include<stdio.h>#include<stdlib.h>#include<string.h>#include<math.h>int main(){ int n,sum,dif,x,y; scanf("%d",&n); while(n--) { scanf("%d%d",&sum,&dif); if(sum<dif||(sum+dif)%2==1) printf("impossible\n"); else { printf("%d %d\n",(sum+dif)/2,(sum-dif)/2); } } return 0;}
0 0
- zoj2388
- zoj2388
- zoj2388
- zoj2388----------------Beat the Spread!
- zoj2388 Beat the Spread!
- ZOJ2388解题报告
- ZOJ2388 Beat the Spread!
- ZOJ2388-Beat the Spread!
- HDU1194 POJ2301 UVA10812 ZOJ2388 Beat the Spread!【数学+水题】
- Opencv之<Vec3b>是什么东东
- 判断是否为平衡二叉树
- iOS10系统之后页面disappear 调用scrollviewdidscroll方法
- oracle运用(八) oracle中的日期查询二
- 使用poi重复读取excel时报错:stream closed
- zoj2388
- @Cacheable、@CachePut和@CacheEvict介绍
- FunDA(4)- 数据流内容控制:Stream data element control
- JavaWeb学习总结十九、JSP标签
- Java反转一个List或ArrayList
- Git教程学习(三)—创建版本库
- poi操作execl如何在cell里做一个超链接访问当前路径文件夹或文件
- Android N数据业务总结
- 队列