File PALIN.PS

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

PROGRAM PALINDROM(INPUT,OUTPUT);
CONST N=50;
VAR WORT:ARRAY [1..N]OF CHAR;
    ERSTER, ZWEITER, HILF:INTEGER;
    PALINDROM:BOOLEAN;
BEGIN ERSTER:=0;
REPEAT ERSTER:=ERSTER+1;
       READ (WORT[ERSTER]);
UNTIL EOLN OR (ERSTER=N);
ZWEITER:=0; PALINDROM:=TRUE;
HILF:= ERSTER;
FOR ERSTER:=HILF DOWNTO 1
DO BEGIN ZWEITER:=ZWEITER+1;
         IF WORT[ZWEITER]<>WORT[ERSTER]
         THEN BEGIN PALINDROM:=FALSE; ERSTER:=1 END
         ELSE BEGIN IF ZWEITER>=ERSTER-1
                    THEN ERSTER:=1 END
   END;
IF PALINDROM
THEN WRITELN("DAS EINGEGEBENE WORT IST EIN PALINDROM.")
ELSE WRITELN ("DAS EINGEGEBENE WORT IST KEIN PALINDROM.")
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