Advertisement
31ph4n70m

minimun_of_two.dart

Nov 21st, 2019
690
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.83 KB | None | 0 0
  1. // dart solution to codeabbey challenge 4
  2. import 'dart:math';
  3.  
  4. void main() {
  5.   var i1 = 30;
  6.     var i2 = "3539875 -2913804 9970403 -1271892 2259745 -5041103 6135274 6702733 -7705887 7333693 9011193 -5815604 -4443223 -3369396 6454782 5927252 8752154 8363617 -4610650 9748221 6825533 -3597316 6931901 7542523 -2603266 9437222 5903501 9517359 -8975159 -2311126 8014504 4564716 4775069 7984907 -6707176 -2965185 -7056195 9428098 -6262451 -4762083 6761791 -7251257 -577687 -7681432 -620653 -4122904 8245820 -1868499 -5759287 -6364830 -2120277 -8933753 37854 -5188376 8608770 7434587 -5751153 4512272 6951946 -4726312";
  7.     var i3 = i2.split(" ");
  8.     var o = "";
  9.   var v1 = 0;
  10.   var v2 = 0;
  11.     for(var c = 0 ; c < i1 ; c += 1 ) {
  12.     v1 = int.parse(i3[c*2]);
  13.     v2 = int.parse(i3[c*2 + 1]);
  14.         o += [v1, v2].reduce(min).toString() + " ";
  15.     }
  16.     print(o);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement