Class hdu-6577

Avin has two integers a, b (1 ≤ a, b ≤ 1, 000).
Given x = a + b and y = a - b, can you calculate ab?
Input
The first line contains two integers x, y.
Output
Print the result of a
b.
Sample Input
4 2
Sample Output
3

#include<iostream>
using namespace std;
int main()
{
	double x,y;
	scanf("%lf%lf",&x,&y);
	double xx=(x+y)/2.0;double yy=(x-y)/2.0;
	cout<<xx*yy<<endl;
	//printf("%d\n",xx*yy);
	return 0;
}
发布了31 篇原创文章 · 获赞 0 · 访问量 341

猜你喜欢

转载自blog.csdn.net/weixin_44828107/article/details/103000454