File SORT.PS

Directory of image this file is from
This file as a plain text file


PROGRAM SORTIEREN(INPUT,OUTPUT);
VAR A, B:REAL;
    STEIGEND, FALLEND, SORTIERT:BOOLEAN;
BEGIN READ(A,B);
WRITE(A:5:1);
STEIGEND:=TRUE; FALLEND:=TRUE; SORTIERT:=TRUE;
REPEAT WRITE(B:5:1);
       IF SORTIERT THEN BEGIN
                        STEIGEND:=STEIGEND AND (A<=B);
                        FALLEND:=FALLEND AND (A>=B);
                        SORTIERT:=STEIGEND OR FALLEND;
                        A:=B
                       END;
       READ(B)
UNTIL EOF;
IF SORTIERT THEN IF STEIGEND AND FALLEND
                     THEN WRITELN("ALLE WERTE GLEICH")
                     ELSE WRITELN("SORTIERT")
           ELSE WRITELN("UNSORTIERT")
END.



Feel free to contact me, David Gesswein djg@pdp8online.com with any questions, comments on the web site, or if you have related equipment, documentation, software etc. you are willing to part with.  I am interested in anything PDP-8 related, computers, peripherals used with them, DEC or third party, or documentation. 

PDP-8 Home Page   PDP-8 Site Map   PDP-8 Site Search