online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
import java.util.Scanner; public class Main { public static void main(String[] args) { // hlavná metódu, spustí sa pri spustení programu Scanner sc = new Scanner(System.in); // vytvorenie Scanera, teda to, čo bude načitávať vstup /* premenné */ int sucet = 0; int input; int i; /* ------- */ for (i = 0;;i++) { // cyklus, počíta iterácie input = Integer.parseInt( sc.nextLine() ); // načítanie vstupu a prevedenie na číslo if (input == 0) break; // podmienka pre nulu, kedy ukončíme cyklus sucet += input; // pričítanie čísla ku vstupu } System.out.println(sucet); // vypísanie súčtu System.out.println(sucet/i); // vypísanie súčtu deleno počet iterácií (čísel) = priemer. } }

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