#include <stdio.h>
int main() {
int layers;
printf("#Create the Christmas Tree#\n"); printf("Enter the number of the first leaf layer (3-19): ");
// ตรวจสอบค่า input
if (layers < 3 || layers > 19) {
printf("Invalid input. Please enter a number between 3 and 19.\n"); return 1;
}
// วาด first leaf layer
for (int i = 0; i < layers; i++) {
for (int j = 0; j < layers - i - 1; j++) {
}
for (int k = 0; k < 2 * i + 1; k++) {
}
}
// วาด second leaf layer
for (int i = 0; i < layers - 1; i++) {
for (int j = 0; j < layers - i - 2; j++) {
}
for (int k = 0; k < 2 * i + 3; k++) {
}
}
// วาดลำต้นของต้นคริสต์มาส
for (int i = 0; i < 2; i++) {
for (int j = 0; j < layers - 2; j++) {
}
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpIHsKICAgIGludCBsYXllcnM7CgogICAgcHJpbnRmKCIjQ3JlYXRlIHRoZSBDaHJpc3RtYXMgVHJlZSNcbiIpOwogICAgcHJpbnRmKCJFbnRlciB0aGUgbnVtYmVyIG9mIHRoZSBmaXJzdCBsZWFmIGxheWVyICgzLTE5KTogIik7CiAgICBzY2FuZigiJWQiLCAmbGF5ZXJzKTsKCiAgICAvLyDguJXguKPguKfguIjguKrguK3guJrguITguYjguLIgaW5wdXQKICAgIGlmIChsYXllcnMgPCAzIHx8IGxheWVycyA+IDE5KSB7CiAgICAgICAgcHJpbnRmKCJJbnZhbGlkIGlucHV0LiBQbGVhc2UgZW50ZXIgYSBudW1iZXIgYmV0d2VlbiAzIGFuZCAxOS5cbiIpOwogICAgICAgIHJldHVybiAxOwogICAgfQoKICAgIC8vIOC4p+C4suC4lCBmaXJzdCBsZWFmIGxheWVyCiAgICBmb3IgKGludCBpID0gMDsgaSA8IGxheWVyczsgaSsrKSB7CiAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCBsYXllcnMgLSBpIC0gMTsgaisrKSB7CiAgICAgICAgICAgIHByaW50ZigiICIpOwogICAgICAgIH0KICAgICAgICBmb3IgKGludCBrID0gMDsgayA8IDIgKiBpICsgMTsgaysrKSB7CiAgICAgICAgICAgIHByaW50ZigiKiIpOwogICAgICAgIH0KICAgICAgICBwcmludGYoIlxuIik7CiAgICB9CgogICAgLy8g4Lin4Liy4LiUIHNlY29uZCBsZWFmIGxheWVyCiAgICBmb3IgKGludCBpID0gMDsgaSA8IGxheWVycyAtIDE7IGkrKykgewogICAgICAgIGZvciAoaW50IGogPSAwOyBqIDwgbGF5ZXJzIC0gaSAtIDI7IGorKykgewogICAgICAgICAgICBwcmludGYoIiAiKTsKICAgICAgICB9CiAgICAgICAgZm9yIChpbnQgayA9IDA7IGsgPCAyICogaSArIDM7IGsrKykgewogICAgICAgICAgICBwcmludGYoIioiKTsKICAgICAgICB9CiAgICAgICAgcHJpbnRmKCJcbiIpOwogICAgfQoKICAgIC8vIOC4p+C4suC4lOC4peC4s+C4leC5ieC4meC4guC4reC4h+C4leC5ieC4meC4hOC4o+C4tOC4quC4leC5jOC4oeC4suC4qgogICAgZm9yIChpbnQgaSA9IDA7IGkgPCAyOyBpKyspIHsKICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IGxheWVycyAtIDI7IGorKykgewogICAgICAgICAgICBwcmludGYoIiAiKTsKICAgICAgICB9CiAgICAgICAgcHJpbnRmKCIqKipcbiIpOwogICAgfQoKICAgIHJldHVybiAwOwp9