import java.io.*; class InputNum { public static void main(String args[]) throws IOException { // Loome andmete sisendvoo DataInputStream'i jaoks DataInputStream inData = new DataInputStream(System.in); String str; double sum = 0.0, j = 0.0; Double i ; System.out.println( "Sisestage arv (0 - väljumiseks)"); do { str = inData.readLine(); try { i= Double.valueOf(str); } catch (NumberFormatException e) { System.out.println("Ebakorrektne formaat."); i = new Double(0.0); } j = i.doubleValue(); sum += j; System.out.println("Summa on " + sum); } while (j !=0.0); } }