Skip to content

Instantly share code, notes, and snippets.

@mikaelo
Created March 22, 2021 20:51
Show Gist options
  • Save mikaelo/42535b2e7cb59758025d39a8e00b925c to your computer and use it in GitHub Desktop.
Save mikaelo/42535b2e7cb59758025d39a8e00b925c to your computer and use it in GitHub Desktop.
Flutter Surf 2.5 Задача 3
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');
}
@artem-zaitsev
Copy link

Тут конечно лучше do .. whille. Но работает и ок)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment