Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
27
Task/Floyds-triangle/Seed7/floyds-triangle.seed7
Normal file
27
Task/Floyds-triangle/Seed7/floyds-triangle.seed7
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
$ include "seed7_05.s7i";
|
||||
|
||||
const proc: writeFloyd (in integer: rows) is func
|
||||
local
|
||||
var integer: number is 1;
|
||||
var integer: numBeforeLastLine is 0;
|
||||
var integer: line is 0;
|
||||
var integer: column is 0;
|
||||
begin
|
||||
numBeforeLastLine := rows * pred(rows) div 2;
|
||||
for line range 1 to rows do
|
||||
for column range 1 to line do
|
||||
if column <> 1 then
|
||||
write(" ");
|
||||
end if;
|
||||
write(number lpad length(str(numBeforeLastLine + column)));
|
||||
incr(number);
|
||||
end for;
|
||||
writeln;
|
||||
end for;
|
||||
end func;
|
||||
|
||||
const proc: main is func
|
||||
begin
|
||||
writeFloyd(5);
|
||||
writeFloyd(14);
|
||||
end func;
|
||||
Loading…
Add table
Add a link
Reference in a new issue