Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // D solution to codabbey challenge 15
- import std.stdio;
- import std.array;
- import std.conv;
- void main() {
- string inp = readln();
- string[300] arr_str = inp.split();
- int[300] RSP;
- int max = 0;
- int min = 0;
- for (int i = 0; i < 300; i++){
- RSP[i] = to!int(arr_str[i]);
- }
- for (int j = 0; j < 300; j++){
- if(RSP[j] > max){
- max = RSP[j];
- }else if(RSP[j] < min){
- min = RSP[j];
- }
- }
- writeln(max, " ", min);
- }
Add Comment
Please, Sign In to add comment