Runnable code
import java.util.Scanner;
public class Test {
###5.0###
###7.0###
$$$0 3 4 0$$$
$$$0 3 0 10$$$
public static void main(String[] args) {
Scanner stdin = new Scanner(System.in);
double x1 = stdin.nextDouble(), y1 = stdin.nextDouble(),
x2 = stdin.nextDouble(), y2 = stdin.nextDouble();
double distance;
@@@
double xDiff = Math.pow(x1-x2, 2);
double yDiff = Math.pow(y1-y2, 2);
distance = Math.sqrt(xDiff + yDiff);
@@@
System.out.print(distance);
}
}
There are three special delimiters
### is used to specify the output from the program. Please note that new line, blank spaces do make difference.
$$$ is used to specify the input(if any) the program would expect from the keyboard. Each $$$ block specifies input for one test case. Each input block should match the corresponding ### block.
@@@ is used to specify the recommended solution from the instructor. We also use this solution to verify that the output from the program based on your solution is correct. If the solution and the output are not consistent, the question will not be saved. You need to
There are two types of runnable exercises:
Runnable fill-in: The context of the code that the students are required to complete is shown.
Runnable tests: The student is presented with a blank working area.
We have also integrated OpenAI in our system, so you can quickly generate a solution based on your problem description.