using System; public class Test{ public static void Main() { int ile; int wynik = 0; while (((ile = Convert.ToInt32(Console.ReadLine()))) != null) { wynik += ile; Console.WriteLine(wynik); } }}
6 8 -3
prog.cs(9,20): warning CS0472: The result of comparing value type `int' with null is always `true' prog.cs(11,26): error CS0165: Use of unassigned local variable `ile' Compilation failed: 1 error(s), 1 warnings
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!