10071-back to High School physics
Time limit:3.000 seconds
Http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=show_problem &problem=1012
A particle has initial velocity and constant acceleration. If it velocity after certain the time is V then what'll its displacement being in twice of?
Input
The input would contain two integers in each line. Each line makes one set of input. These two integers denote the value of V ( -100 <= v-<=) and T (0<=t<=) (t means at the time the Partic Le gains that velocity)
Output
For the, input print a single integer in one line denoting the "displacement in double".
Sample Input
0 0
5 12
Sample Output
0
120
Complete code:
/*0.029s*/
#include <cstdio>
int main (void)
{
int v, t;
while (~SCANF ("%d%d", &v, &t)
printf ("%d\n", V * t << 1);
return 0;
}
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/sjjg/