Teks buku anak-anak Beruang Kutub, Beruang Kutub, Apa yang Kamu Dengar? memiliki pola yang sangat sederhana. Anda mungkin menggunakan teks untuk mengajarkan konsep pemrograman pengantar.
Anak saya cepat bosan dengan ide ini, jadi saya memutuskan untuk bermain golf dengannya.
Tantangan
Dalam bahasa pemrograman pilihan Anda, tulislah program sekecil mungkin yang akan mencetak teks berikut. Output harus sama persis, termasuk case, spasi, dan tanda baca.
Polar Bear, Polar Bear, what do you hear?
I hear a lion roaring in my ear.
Lion, Lion, what do you hear?
I hear a hippopotamus snorting in my ear.
Hippopotamus, Hippopotamus, what do you hear?
I hear a flamingo fluting in my ear.
Flamingo, Flamingo, what do you hear?
I hear a zebra braying in my ear.
Zebra, Zebra, what do you hear?
I hear a boa constrictor hissing in my ear.
Boa Constrictor, Boa Constrictor, what do you hear?
I hear an elephant trumpeting in my ear.
Elephant, Elephant, what do you hear?
I hear a leopard snarling in my ear.
Leopard, Leopard, what do you hear?
I hear a peacock yelping in my ear.
Peacock, Peacock, what do you hear?
I hear a walrus bellowing in my ear.
Walrus, Walrus, what do you hear?
I hear a zookeeper whistling in my ear.
Zookeeper, Zookeeper, what do you hear?
I hear children...
...growling like a polar bear,
roaring like a lion,
snorting like a hippopotamus,
fluting like a flamingo,
braying like a zebra,
hissing like a boa constrictor,
trumpeting like an elephant,
snarling like a leopard,
yelping like a peacock,
bellowing like a walrus...
that's what I hear.
B
dan C
dalam Polar Bear
dan Boa Constrictor
perlu? (Dalam Batch ini biayanya 10% dari jumlah byte saya ...)