aiheshan

有多自律,才能有多自由

导航

UVa 10071 - Back to High School Physics

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=show_problem&problem=1012

思路:题目为质点有初速度和匀加速度a,t时间后速度为v,那么2t时间内的位移为多少?

设初速度为v0,加速度为a,t时间后速度为v=v0+at;位移s=v0*t+a*t^2/2;

2t时间内的位移为s1 = v0*2t+a*(2t)^2 / 2 =2v0*t+2a*t^2=2t(v0+at)=2tv;

 1 #include<iostream>
 2 using namespace std;
 3 
 4 int main()
 5 {
 6    int v,t;
 7    while(cin>>v>>t)
 8    {
 9        cout<<2*v*t<<endl;
10    }
11     return 0;
12 }

 

posted on 2016-08-03 16:42  aiheshan  阅读(124)  评论(0编辑  收藏  举报