online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
// https://www.programiz.com/java-programming/online-compiler/ import java.util.Random; public class CarreraApp{ final static int EQUIPOS = 8, POSTAS = 4; public static void main(String[] args){ Equipo[] eqs = new Equipo[EQUIPOS]; for(int i= 0; i<EQUIPOS; i++){ eqs[i] = new Equipo(i+1); eqs[i].correr(); } ordenar(EQUIPOS, eqs); System.out.println("\tBienvenidos a la carrera de 4 postas"); System.out.println("Equipo\tTiempos ordenamos por TOTAL"); System.out.println(" \tPosta 0\tPosta 1\tPosta 2\tPosta 3\tTotal"); for(int i=0; i<EQUIPOS; i++){ System.out.print(eqs[i].numero + "\t"); for(int j=0; j<POSTAS; j++){ System.out.print(eqs[i].tiempoCorredor[j] + "\t"); } System.out.print(eqs[i].tiempo + "\n"); } System.out.println("Felicidades al equipo " + eqs[0].numero + ", ganador de la carrera."); } public static void ordenar(int n, Equipo eqs[]){ for(int i=1; i<n; i++){ for(int j=0; j<n-i; j++){ if(eqs[j].tiempo > eqs[j+1].tiempo){ Equipo aux = eqs[j]; eqs[j] = eqs[j+1]; eqs[j+1] = aux; } } } } } class Equipo { Random ran = new Random(); int numero; int tiempo; int[] tiempoCorredor = new int[CarreraApp.POSTAS]; Equipo(int numero){ this.numero = numero; } public void correr(){ for(int i=0; i<CarreraApp.POSTAS; i++){ tiempoCorredor[i] = ran.nextInt(4)+10; tiempo += tiempoCorredor[i]; } } }

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