Created
January 11, 2017 03:36
-
-
Save sgoguen/840d776351f0f62c2cdc950043900189 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() { | |
string line; | |
int runningTotal = 0, input = 0; | |
do { | |
line = Console.ReadLine(); | |
if (Int32.TryParse(line, out input)) { | |
runningTotal += input; | |
Console.WriteLine(runningTotal); | |
} else if (line == "quit" || line == null) { | |
return; | |
} | |
} while (line != null); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment