題目連結
題意:
測資輸入 v 速度,t 時間,求2倍該時間的等速度運動位移是多少
解法:
直接輸出 2*v*t 的結果即可
程式(Java):
題意:
測資輸入 v 速度,t 時間,求2倍該時間的等速度運動位移是多少
解法:
直接輸出 2*v*t 的結果即可
程式(Java):
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
import java.util.*; | |
class Main{ | |
public static void main(String args[]){ | |
Scanner input = new Scanner(System.in); | |
while (input.hasNext()){ | |
int v = input.nextInt(); //-100 ~ 100 | |
int t = input.nextInt(); // 0 ~ 200 | |
System.out.println(2 * t * v); | |
} | |
} | |
} |
留言
張貼留言