Advertisement
pablo7890

Untitled

Feb 28th, 2013
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.44 KB | None | 0 0
  1. var
  2.     t:array[1..50,1..50]of byte;
  3.     w,k,l,m,j,r:longint;
  4. begin
  5.     readln(r);
  6.     t[1,1]:=1;
  7.     t[2,1]:=1;
  8.     t[2,2]:=1;
  9.     for w:=3 to r do
  10.         begin
  11.         t[w,1]:=1;t[w,w]:=1;
  12.         for m:=2 to r-1 do
  13.             t[w,m]:=(t[w-1,m-1]+t[w-1,m]) mod 10
  14.     end;
  15.     for w:=1 to r do
  16.         begin
  17.         for k:=1 to w do
  18.             if  t[w,k] mod 2 = 1 then write('X') else write(' ');
  19.         writeln;
  20.     end;
  21. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement