URAL 2001. Mathematicians and Berries
来源:互联网 发布:gis是什么软件 编辑:程序博客网 时间:2024/05/21 19:38
2001. Mathematicians and Berries
Time limit: 0.5 second
Memory limit: 64 MB
Memory limit: 64 MB
One day, two mathematicians were walking in the forest and picking berries. They’d been walking for two hours, and then they stopped and decided to see who’s got more berries. They took out the scales (can you imagine a mathematician going to the forest without any scales?) and they weighed their baskets with berries. They wrote the resulting numbers a1 and b1 down on a piece of paper. Then the second mathematician put all his berries to the first one’s basket (so that his basket became completely empty) and they weighed their baskets again and they received numbers a2 and b2, correspondingly. At last, the first mathematician put all the berries to the second one’s basket (so that his basket became completely empty); they weighed the baskets and got numbers a3 and b3, correspondingly. This data was enough to find the winner and the happy mathematicians moved on. Your task is to calculate the mass of the berries in each mathematician’s basket by the start of the competition.
Input
The input data consists of three lines. The i’th line (1 ≤ i ≤ 3) contains integers ai and bi (0 ≤ ai, bi ≤ 10 000).
Output
Output the weight of berries in the basket of the first and the second mathematician correspondingly.
Sample
1 22 10 3
1 1
第一组数据全部是总重,第二三组就分别有筐重,找对数据做差就能算出净重了,灰常简单~
#include<cstdio>#include<iostream>using namespace std;int a[10];int main(){ int j=0; for(int i=0;i<3;i++) { cin>>a[j++]; cin>>a[j++]; } cout<<a[0]-a[4]<<" "<<a[1]-a[3]<<endl; return 0;}
0 0
- URAL 2001. Mathematicians and Berries
- URAL 2001 Mathematicians and Berries (小学数学题)
- URAL 2067. Friends and Berries
- URAL 2067 Friends and Berries
- Ural 2067 Friends and Berries 【思维】
- ural 2067 Friends and Berries 数学推理
- Mathematicians and brackets
- C++ for Mathematicians: An Introduction for Students and Professionals
- URAL 1026. Questions and answers
- ural 1026 Questions and Answers
- hdu 3068 and ural 1297
- Ural 1548 Sakura and Statistics
- URAL:1200 Horns and Hoofs
- Ural 1430. Crime and Punishment
- Ural 1195 Ouths and Crosses
- URAL 1635. Mnemonics and Palindromes
- ural 1809 Chapaev and Potatoes
- URAL 1553【CAVE and TUNNEL】
- Oracle中创建用户和授权|ORA-01045 解决
- easyUI跨tab刷新datagrid
- kali linux 安装samb共享,只要几步,精简配置
- 机器学习 --- 1. 线性回归与分类, 解决与区别
- 人工智能、机器学习、统计学和数据挖掘之间有什么区别?
- URAL 2001. Mathematicians and Berries
- 小马哥----高仿红米note 主板为x2 分屏幕驱动 机型版本多 拆机主板详图 注意看排线
- uva 10130 SuperSale (01背包)
- 比较数的大小
- 最大公约数算法
- jquery 重置表单里的元素
- 交换两个数的值
- Leetcode-Number of 1 Bits
- 机器学习笔记-线性回归