Comment detail

ピラミッドを作る (Nested Flatten)
ごく普通に。
1
2
3
4
5
6
7
8
<?php
function pyramid($n){
	for($i = 0; $i < $n; $i++){
		printf("%s%s\n", str_repeat(' ', $n - $i), str_repeat('*', 2 * $i + 1));
	}
}
pyramid(4);
?>

Index

Feed

Other

Link

Pathtraq

loading...