Created
March 6, 2021 21:36
-
-
Save rodion-m/62400072f6b72bd516e53a4fd1ef30f8 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
import 'dart:convert'; | |
import 'dart:io'; | |
void main(List<String> arguments) { | |
String? input; | |
var acc = 0.0; | |
do { | |
input = stdin.readLineSync(encoding: utf8); | |
try { | |
acc += double.parse(input ?? ""); | |
print(acc); | |
} catch(e) { | |
acc = 0.0; | |
print("reseted"); | |
} | |
} while(input != "stop"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment