UVA 1643(p343)----Angles and Squares
来源:互联网 发布:深入浅出node.js 网盘 编辑:程序博客网 时间:2024/05/06 03:05
#include<iostream>#include<cstdio>#include<algorithm>#include<cmath>using namespace std;double xa,ya,xb,yb,k1,k2;int main(){ int n; while(scanf("%d",&n)==1&&n) { double l=0.0,tmp=0.0,area; scanf("%lf%lf%lf%lf",&xa,&ya,&xb,&yb); for(int i=0;i<n;i++) { double x; scanf("%lf",&x); tmp+=x*x/2; l+=x; } k1=ya/xa;k2=yb/xb; if(k1<k2) swap(k1,k2); xa=l*(1+k2)/(k1-k2); ya=k1*xa; xb=l*(1+k1)/(k1-k2); yb=k2*xb; area=fabs(xa*yb-xb*ya)/2; printf("%.3lf\n",area-tmp); } return 0;}
0 0
- UVA 1643(p343)----Angles and Squares
- Angle and Squares UVA
- UVa 1643 - Angle and Squares(叉乘求面积)
- UVA 1644(p343)----Prime Gap
- jrMz and angles
- jrMz and angles
- HDU jrmz and angles
- jrMz and angles
- jrMz and angles 暴力
- UVA 1213(p343)----Sum of Different Primes
- UVA 10539(p343)----Almost Prime Numbers
- UVA 10622(p343)----Perfect Pth Powers
- BC-水题 jrMz and angles
- BC之jrMz and angles
- 习题10-3 UVA 1643 Angle and Squares 角度和正方形
- UVA 1210(p343)----Sum of Consecutive Prime Numbers
- 【杭电】[5660]jrMz and angles
- 【HDU 5660】【水题】jrMz and angles
- Linux系统monitor命令
- IOS多线程开发详解
- iOS MTA的SDK插入,以及基本功能实现
- 23种设计模式(15):观察者模式
- nginx开发(一) 源码-编译
- UVA 1643(p343)----Angles and Squares
- Java常见内存溢出(OOM)解决方案
- JavaWeb学习总结(二)——Tomcat服务器学习和使用(一) http://www.cnblogs.com/xdp-gacl/p/3734395.html
- Windows下AndroidStudio 中使用Git(AndroidStudio项目于GitHub关联)
- SAS - Campaign QC New
- UVA 1644(p343)----Prime Gap
- POJ 2754 Similarity of necklaces 2
- javaWeb项目读取properties配置文件
- iOS 中有用的开源库