The program code for printing Pascal’s Triangle.
所有检测均成功
The build was successful.

这个提交包含在:
Rafal Kupiec 2019-04-20 13:49:45 +02:00
父节点 18e77b9754
当前提交 3f1d429d5f
签署人:: belliash
GPG 密钥 ID: 4E829243E0CFE6B4
共有 2 个文件被更改,包括 30 次插入0 次删除

25
tests/pascal_triangle.aer 普通文件
查看文件

@ -0,0 +1,25 @@
class Program {
private int fun(int $y) {
int $result = 1;
for(int $z = 1; $z <= $y; $z++) {
$result *= $z;
}
return $result;
}
void main() {
int $z;
int $y = 5;
for(int $x = 0; $x < $y; $x++) {
for($z = 0; $z <= ($y - $x - 2); $z++) {
print(' ');
}
for($z = 0; $z <= $x; $z++) {
print($this->fun($x) / ($this->fun($z) * $this->fun($x - $z)), ' ');
}
print("\n");
}
}
}

5
tests/pascal_triangle.exp 普通文件
查看文件

@ -0,0 +1,5 @@
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1