2019-04-13 14:37:04 +02:00
|
|
|
class Program {
|
|
|
|
|
|
|
|
string cycle(char $a, char $b, int $i = 0) {
|
2019-04-19 06:40:16 +02:00
|
|
|
static bool[] $switches;
|
2019-04-13 14:37:04 +02:00
|
|
|
if($switches[$i])
|
|
|
|
$switches[$i] = !$switches[$i];
|
|
|
|
else
|
|
|
|
!($switches[$i] = true);
|
|
|
|
return ($switches[$i]) ? $a : $b;
|
|
|
|
}
|
|
|
|
|
|
|
|
void main() {
|
2019-04-16 13:59:10 +02:00
|
|
|
for(int $i = 1; $i < 3; $i++) {
|
2019-04-13 14:37:04 +02:00
|
|
|
print($i + $this->cycle('a', 'b') + PHP_EOL);
|
2019-04-16 13:59:10 +02:00
|
|
|
for(int $j = 1; $j < 5; $j++) {
|
2019-04-13 14:37:04 +02:00
|
|
|
print(' ' + $j + $this->cycle('a', 'b', 1) + PHP_EOL);
|
2019-04-16 13:59:10 +02:00
|
|
|
for(int $k = 1; $k < 3; $k++) {
|
2019-04-13 14:37:04 +02:00
|
|
|
print(' ' + $k + $this->cycle('c', 'd', 2) + PHP_EOL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|