-- Ada 2012 implementierung von der SP1 Aufgabe "wsort"; -- Kann man mit "gnatmake wsort" bauen. with ada.text_io; with ada.containers.vectors; with ada.strings.bounded; procedure wsort is package line is new ada.strings.bounded.generic_bounded_length ( max => 100 ); package line_vector is new ada.containers.vectors ( index_type => natural, element_type => line.bounded_string, "=" => line."=" ); package lex is new line_vector.generic_sorting ( "<" => line."<" ); lines : line_vector.vector; use ada.text_io; begin while not end_of_file(standard_input) loop lines.append(line.to_bounded_string(ada.text_io.get_line)); end loop; lex.sort(lines); for b of lines loop ada.text_io.put_line(line.to_string(b)); end loop; end wsort;