我想在加速度输出中以米为单位显示米/秒(2)。我应该使用哪个关键字?
public class Distance {
public static void main(String[] args)
{
int distance,init_velocity,time,acceleration;
acceleration=10;
init_velocity=20;
time=20;
distance=(init_velocity*time)+((acceleration*time*time)/2);
System.out.println("-------------------------------------------------------------------------");
System.out.println("Distance travelled by John ="+ distance+" "+"meters" );
System.out.println("-------------------------------------------------------------------------");
}
}
答案 0 :(得分:1)
尝试:System.out.println("meter/second\u00b2");