online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
// //C3.java import java.lang.Math; import java.util.Scanner //public class C3{ public class Main{ static double distancia=0; public static void main(String[] args){ System.out.println("Paseo de la Hormiga"); paseo(); System.out.printf("La atleta ha recorrido: %.2f km.\n", distancia); } static void paseo(){ Scanner sc = new Scanner(System.in); double x0, y0, xa, ya, x, y; // ver sugerencia de diseño en el problema System.out.print("ingrese el inicio en R2 (x, y): "); x0 = sc.nextDouble(); y0 = sc.nextDouble(); xa = x0; ya = y0; x = x0+1; // se suma cualquier número y = y0+1; while(x!=x0 || y!=y0){ // repetición System.out.print("ingrese un punto en R2 (x, y): "); x = sc.nextDouble(); y = sc.nextDouble(); distancia += Math.sqrt((x-xa)*(x-xa) + (y-ya)*(y-ya)); xa = x; ya = y; } distancia += Math.sqrt((x0-xa)*(x0-xa) + (y0-ya)*(y0-ya)); // fin } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue