Created
March 22, 2021 20:51
-
-
Save mikaelo/42535b2e7cb59758025d39a8e00b925c to your computer and use it in GitHub Desktop.
Flutter Surf 2.5 Задача 3
This file contains 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:io'; | |
void main() { | |
var total = 0; | |
for (;;) { | |
stdout.write("Input number or 'stop': "); | |
var input = stdin.readLineSync()!; | |
if (input == 'stop') break; | |
var n = int.tryParse(input); | |
if (n != null) total += n; | |
} | |
print('Total $total'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Тут конечно лучше do .. whille. Но работает и ок)