P.S. 因為是一等加速度,所以位移的公式就是 平均速度 * 經過的時間,
而因為正好是要兩倍時間後的位移,所以此時的速度即為平均速度,再乘上2倍時間即得解。
[C](0.028)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
int main() | |
{ | |
int v, t; | |
while( scanf( "%d%d", &v, &t ) != EOF ) | |
printf( "%d\n", 2*v*t ); | |
return 0; | |
} |
[C++](0.132)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
int main() | |
{ | |
int v, t; | |
while( cin >> v >> t ) | |
cout << 2*v*t << endl; | |
return 0; | |
} |
0 意見:
張貼留言