[第一次训练]Eming
来源:互联网 发布:淘宝分享到微信怎么弄 编辑:程序博客网 时间:2024/05/24 00:48
Eming
Eming is a contest hold by WHUACM training team. The aim is to select new members of the team.
Usually, the first problem is a very simple problem such as “a+b problem”. But this time, Xioumu is tired of this kind of problem, he decide to solve “a and b problem”.
Give you the result of a + b and a^2 – b^2, please output the result of a and b.
Input
There are several test cases. For each case there are two double numbers indicating a+b and a^2-b^2. You may assume that a+b will not be zero.
Output
For each case please output the result of a and b in one line, rounded to 2 decimal places.
Sample Input
3 -3
Sample Output
1.00 2.00
解题报告
此题纯水题,由题意可知x+y=a,x^2-y^2=b,即可解得a=(y+x*x)/(2*x) b=(y-x*x)/(-(2*x)),代码如下
#include<stdio.h>int main(){ double x,y,a,b; while(scanf("%lf%lf",&x,&y)!=EOF) { a=(y+x*x)/(2*x); b=(y-x*x)/(-(2*x)); printf("%.2lf %.2lf\n",a,b); } return 0;}
- [第一次训练]Eming
- Eming
- Eming
- Eming
- [第一次训练]Arithmetic Progression
- [第一次训练]Brackets
- [第一次训练]Function
- 蓝桥杯训练第一次作业
- 2013第一次组队训练赛
- 深入word2vec(1) - 第一次训练
- IMWeb训练营作业第一次
- 2016 qut第一次训练赛简单题
- 2016省赛第一次组队训练总结
- 2016-8-15 第一次训练 代码
- C++第一次上机训练项目二
- C++第一次上机训练项目三
- imweb 前端训练营第一次作业[更新]
- hdu5326 Work(Jnu第一次训练G)
- Loadrunner录制使用ajax性能测试脚本方法
- NYOJ 491 幸运三角形
- ZOJ Problem Set - 1003 Crashing Balloon
- 文本查询程序--摘自c++primer
- Linux C库之- 文件操作篇
- [第一次训练]Eming
- SSHE开发手册
- Oracle常用调优手段
- 当别人开始说你是疯子的时候,你离成功就不远了
- 补码负数多一个的问题
- NYOJ 42 一笔画问题
- Ubuntu 13.04 安装JDK7
- 浅谈C#中的属性
- uva442 栈