31ph4n70m

Maximum_of_array.dart

Nov 28th, 2019
559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.51 KB | None | 0 0
  1. // dart solution to codeabbey challenge 15
  2. import 'dart:io';
  3. void main() {
  4.     var inp = stdin.readLineSync();
  5.     var arr_str = inp.split(" ");
  6.     var RSP = [];
  7.     var max = 0;
  8.     var min = 0;
  9.     for (var i = 0; i < 300; i++){
  10.         RSP.add(int.parse(arr_str[i]));
  11.     }
  12.     for (var j = 0; j < 300; j++){
  13.         if(RSP[j] > max){
  14.             max = RSP[j];
  15.         }else if(RSP[j] < min){
  16.             min = RSP[j];
  17.         }
  18.     }
  19.     var RES = max.toString() + " " + min.toString();
  20.     print(RES);
  21. }
Add Comment
Please, Sign In to add comment