File:  [CSRG BSD Unix] / 43BSDReno / pgrm / pascal / tstpx / src / palindromes.p
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 palindromes(output);
  var i,j,l,n,r,s: integer;
      p: boolean;
      d: array [1..10] of integer;
begin n := 0; writeln(wallclock);
  repeat n := n+1; s := n*n; l := 0;
    repeat l := l+1; r := s div 10;
      d[l] := s - 10*r; s := r
    until s = 0;
    i := 1; j := l;
    repeat p := d[i]=d[j];
      i := i+1; j := j-1
    until (i>=j) or not p;
    if p then writeln(n,n*n)
  until n = 200;
  writeln(wallclock)
end .

unix.superglobalmegacorp.com

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