blob: 16bcc2c8ca5aa87bee818d773c34616b2cab824b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
|
class Distance
{
public static void main(String... args)
{
double x = Double.parseDouble(args[0]);
double y = Double.parseDouble(args[1]);
System.out.printf("The distance from (%g, %g) to origin is %g\n",
x, y, Math.sqrt(x*x + y*y));
}
}
|