File:  [CSRG BSD Unix] / 43BSDReno / pgrm / pascal / tstpx / out / pretty.out
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:57 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43reno
BSD 4.3reno

 program bench3 ( input , output ) ;

 const max = 100 ;

 var i , len : integer ;
 inline : packed array [ 1 .. max ] of char ;
 palind : Boolean ;
 begin
    while not eof do begin
       len := 0 ;
       while not eoln do begin
          len := len + 1 ;
          inline [ len ] := input ^ ;
          get ( input )
       end ;
       readln ;
       while ( len > 1 ) and ( inline [ len ] =' ' ) do len := len - 1 ;
       palind := true ;
       for i := len downto len div 2 do if inline [ i ] <> inline [ len - i + 1 ] then palind := false ;
       for i := 1 to len do write ( inline [ i ] ) ;
       write (' is' ) ;
       if not palind then write (' not' ) ;
       writeln (' a palindrome' ) ;
    end
 end .

19711 statements executed in 3.90 seconds cpu time.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.