شعر آن آهنگ تکراری و محبوب کودکان را بخوانید: «Ten Green Bottles».
توجه کنید که همهی بندها یکسان نیستند.
Ten green bottles hanging on the wall,
Ten green bottles hanging on the wall,
And if one green bottle should accidentally fall,
There'll be nine green bottles hanging on the wall.
Nine green bottles hanging on the wall,
Nine green bottles hanging on the wall,
And if one green bottle should accidentally fall,
There'll be eight green bottles hanging on the wall.
Eight green bottles hanging on the wall,
Eight green bottles hanging on the wall,
And if one green bottle should accidentally fall,
There'll be seven green bottles hanging on the wall.
Seven green bottles hanging on the wall,
Seven green bottles hanging on the wall,
And if one green bottle should accidentally fall,
There'll be six green bottles hanging on the wall.
Six green bottles hanging on the wall,
Six green bottles hanging on the wall,
And if one green bottle should accidentally fall,
There'll be five green bottles hanging on the wall.
Five green bottles hanging on the wall,
Five green bottles hanging on the wall,
And if one green bottle should accidentally fall,
There'll be four green bottles hanging on the wall.
Four green bottles hanging on the wall,
Four green bottles hanging on the wall,
And if one green bottle should accidentally fall,
There'll be three green bottles hanging on the wall.
Three green bottles hanging on the wall,
Three green bottles hanging on the wall,
And if one green bottle should accidentally fall,
There'll be two green bottles hanging on the wall.
Two green bottles hanging on the wall,
Two green bottles hanging on the wall,
And if one green bottle should accidentally fall,
There'll be one green bottle hanging on the wall.
One green bottle hanging on the wall,
One green bottle hanging on the wall,
And if one green bottle should accidentally fall,
There'll be no green bottles hanging on the wall.
متن ترانه را بهصورت رشتهای خروجی بدهید که با پوچ پایان مییابد.
| ثبات | کاربرد | نوع | توضیحات |
|---|---|---|---|
$a0 |
ورودی | عدد صحیح | بطریهای شروع |
$a1 |
ورودی | عدد صحیح | برداشتن |
$a2 |
ورودی/خروجی | آدرس | رشتهی خروجی که با پوچ پایان مییابد |
$t0-9 |
موقت | هر نوع | برای ذخیرهسازی موقت |
در Exercism ثبتنام کنید تا MIPS Assembly را همراه با 70 تمرین و مربیگری انسانی واقعی یاد بگیرید و در آن استاد شوید، همهی اینها رایگان.