Skip to main content
deleted 13 characters in body
Source Link
manatwork
  • 20.9k
  • 5
  • 53
  • 82

Pascal: 216216 192 characters

(Not a real competitor, just an honorific presence.)

var p:array[0..1,10..25]of Integer;iLongInt;i,j,n,u:Word;s:string;beginWord;begin Readln(s);ValRead(s,n,i);u:=0;for i:=1 to=1to n do begin p[1,1]:=1;for j:=1 to=1to i do begin p[u,j]:=p[1-u,j-1]+p[1-u,j];Write(p[u,j],' ')end;u:=1-u;Writeln end end. 

Sample run:

bash-4.2$ fpc pascal.pas /usr/bin/ld: warning: link.res contains output sections; did you forget -T? bash-4.2$ ./pascal <<< 1 1 bash-4.2$ ./pascal <<< 9 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 35 35 21 7 1 1 8 28 56 70 56 28 8 1 

Pascal: 216 characters

(Not a real competitor, just an honorific presence.)

var p:array[0..1,1..25]of Integer;i,j,n,u:Word;s:string;begin Readln(s);Val(s,n,i);u:=0;for i:=1 to n do begin p[1,1]:=1;for j:=1 to i do begin p[u,j]:=p[1-u,j-1]+p[1-u,j];Write(p[u,j],' ')end;u:=1-u;Writeln end end. 

Sample run:

bash-4.2$ fpc pascal.pas /usr/bin/ld: warning: link.res contains output sections; did you forget -T? bash-4.2$ ./pascal <<< 1 1 bash-4.2$ ./pascal <<< 9 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 35 35 21 7 1 1 8 28 56 70 56 28 8 1 

Pascal: 216 192 characters

(Not a real competitor, just an honorific presence.)

var p:array[0..1,0..25]of LongInt;i,j,n,u:Word;begin Read(n);u:=0;for i:=1to n do begin p[1,1]:=1;for j:=1to i do begin p[u,j]:=p[1-u,j-1]+p[1-u,j];Write(p[u,j],' ')end;u:=1-u;Writeln end end. 

Sample run:

bash-4.2$ fpc pascal.pas /usr/bin/ld: warning: link.res contains output sections; did you forget -T? bash-4.2$ ./pascal <<< 1 1 bash-4.2$ ./pascal <<< 9 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 35 35 21 7 1 1 8 28 56 70 56 28 8 1 
Source Link
manatwork
  • 20.9k
  • 5
  • 53
  • 82

Pascal: 216 characters

(Not a real competitor, just an honorific presence.)

var p:array[0..1,1..25]of Integer;i,j,n,u:Word;s:string;begin Readln(s);Val(s,n,i);u:=0;for i:=1 to n do begin p[1,1]:=1;for j:=1 to i do begin p[u,j]:=p[1-u,j-1]+p[1-u,j];Write(p[u,j],' ')end;u:=1-u;Writeln end end. 

Sample run:

bash-4.2$ fpc pascal.pas /usr/bin/ld: warning: link.res contains output sections; did you forget -T? bash-4.2$ ./pascal <<< 1 1 bash-4.2$ ./pascal <<< 9 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 35 35 21 7 1 1 8 28 56 70 56 28 8 1