Zoj 3936 Apples and Ideas【水】
来源:互联网 发布:java线程池控制并发 编辑:程序博客网 时间:2024/06/06 07:47
"If you have an apple and I have an apple and we exchange these apples then you and I will still each have one apple. But if you have an idea and I have an idea and we exchange these ideas, then each of us will have two ideas." - George Bernard Shaw
Now Alice has A apples and B ideas, while Bob has C apples and D ideas, what will they have if they exchange all things?
Input
There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:
The only line contains four integers A, B, C, D (0 <= A, B, C, D <= 100) - as the problem described.
Output
For each test case, output two lines. First line contains two integers, indicating the number of Alice's apples and ideas; second line contains two integers, indicating the number of Bob's apples and ideas.
Sample Input
40 0 5 3020 25 20 020 25 20 1520 25 25 30
Sample Output
5 300 3020 2520 2520 4020 4025 5520 55
#include<cstdio>#include<cstring>#include<algorithm>using namespace std;int main(){int t;scanf("%d",&t);while(t--){int a,b,c,d;scanf("%d%d%d%d",&a,&b,&c,&d);swap(a,c);printf("%d %d\n",a,b+d);printf("%d %d\n",c,b+d); }return 0;}
- Zoj 3936 Apples and Ideas【水】
- ZOJ 3936Apples and Ideas
- zoj-3936-Apples and Ideas
- ZOJ-3936(Apples and Ideas)
- zoj Apples and Ideas (水)
- ZOJ 3936 Apples and Ideas(水题)
- A - Apples and Ideas
- ZOJ3936-Apples and Ideas
- ZOJ 3936-Apples and Ideas【模拟】(2016浙江省大学生程序设计竞赛)
- 13届浙江省省赛 A题 Apples and Ideas
- 【ZOJ3936 The 13th Zhejiang Provincial Collegiate Programming ContestA】【水题】Apples and Ideas 苹果交换与思想交换
- C. Oranges and Apples
- BlueEyes and Apples (I)
- CodeForces 632 A.Grandma Laura and Apples(水~)
- 《Chomsky: ideas and ideals》笔记
- Frama-C news and ideas
- 449 C. Jzzhu and Apples
- codeforces_632A.Grandma Laura and Apples
- C++中去除字符串中的无效字符,用于加载配置文件
- HDU-ACM2043
- matlab--关机命令与断点命令
- NO.1 上下机-----机房收费
- 191.Number of 1 Bits
- Zoj 3936 Apples and Ideas【水】
- Ubuntu / CentOS Guide to Install OpenCart
- pwnable.kr之flag
- HDU-ACM2044--Fibonacci数列的应用
- 学之者生,用之者死——ACE历史与简评
- java之Set接口
- [OpenCV] -- win7下配置OpenCV的Qt开发环境
- UINavigationController、UITabBarController
- 时间戳在游戏当中的运用