Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:想知道这题这么做的~~~ 麻烦ac了的人说说In Reply To:想知道这题这么做的~~~ 麻烦ac了的人说说 Posted by:liangzhirong at 2005-10-14 10:15:03 #include<iostream> #include<iomanip> #include<cmath> using namespace std; const double Pi=3.141592653; int main() { double a,b,s,m,n; while(cin>>a>>b>>s>>m>>n) { double degree1,degree2,v; if(a==0&&b==b&&s==0&&m==0&&n==0)break; degree1=atan(n*b/(m*a)); v=(b*n)/(sin(degree1)*s); degree2=degree1/Pi*180.0; cout<<fixed<<setprecision(2)<<degree2<<' '<<v<<endl; } return 0; } 就是把速度分解一下,简单的高中物理!无论垂直还是水平运动,每折两次来回都是长或宽的2倍,我是用C++写的,47ms,那位大牛有更好的方法,还望多多指教! Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator