online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
import java.util.Random; //class Rand4App{ class Main{ static Random ran = new Random(); public static void main(String[] args){ int NumJug=rand(3, 10), NumVez=rand(4, 15), MaxGan=10; int numJug, numVez, jugGan, dinGan; int [] totales = new int[NumJug]; int j; // Títulos System.out.printf("\tRand4App\n NV: "); for(numJug=0; numJug<NumJug; numJug++) System.out.printf("J%d ", numJug+1); System.out.println(); // Arreglo de formatos para los ganadores de las juegos String [] formats = new String[NumJug]; for(numJug=0; numJug<NumJug; numJug++) { formats[numJug] = " %2d:"; for(j=0; j<numJug; j++) formats[numJug] += " "; formats[numJug] += "%4d\n"; } // jugando for(numVez=1; numVez<=NumVez; numVez++){ jugGan = rand(1, NumJug)-1; // valor del índice ganador dinGan = rand(1, MaxGan); System.out.printf(formats[jugGan], numVez, dinGan); // imprime totales[jugGan] +=dinGan; // totaliza } // Impresión final System.out.print("Total:"); int max=totales[0], pos=0; for(numJug=0; numJug<NumJug; numJug++) { System.out.printf("%4d", totales[numJug]); // imprime totales if(max<totales[numJug]){max = totales[numJug]; pos = numJug;} // calcula el máximo } System.out.printf("\nFelicitaciones al ganador: J%d\n", pos+1); } static int rand(int inf, int sup){ return inf + ran.nextInt(sup-inf+1); } }

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