import 'dart:io';
void addUp() {
var input = '';
double sum = 0;
do {
input = stdin.readLineSync();
double value = double.tryParse(input);
if (value == null) {
if (input == 'stop') {
break;
}
print('Incorrect input: ${input}');
continue;
}
sum += value;
print('Sum: ${sum}');
} while (true);
}
void main() {
addUp();
}
Created
October 1, 2020 20:30
-
-
Save Headmast/25b92bfdc1d65b4a75e8c3b3a6a467a2 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
да, косяк, не предоставили саму функцию. Учтем