10071 - Back to High School Physics

解题思路:php

1. 两个基本物理公式spa

    V = V0 + a*t  (V0为初速度, a 为加速度, t 为时间, V 为当前速度)code

    S = (V + V0) * t / 2 (V0为初速度, V 为末速度, t 为时间)blog

 

2. 由题目可知, 输入的是 t 和 t 时间处的 V, 则2t时间处的 S = ((V0 + a*2*t) + V0) * 2*t / 2 = (V0 + a*t) * 2*t ip

   即所求 S = V * 2 * t  (V 为 t 时间处的速度)get

 

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

代码:pip

#include <stdio.h>
int main() { int v, t; while(EOF != scanf("%d%d", &v, &t)){ printf("%d\n", 2*v*t); } return 0; }

环境:ANSI C 4.5.3 - GNU C Compiler with options: -lm -lcrypt -O2 -pipe -ansi -DONLINE_JUDGEio

相关文章
相关标签/搜索