Треки
/
MIPS Assembly
MIPS Assembly
/
Вправи
/
Пісня про пляшки
Пісня про пляшки

Пісня про пляшки

Середня

Вказівки

Зачитайте слова цієї популярної дитячої пісеньки з повторами: «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.

Формат вихідних даних

Виведіть текст пісні як рядок тексту (англ. string), що завершується нульовим символом.

Регістри

Регістр Використання Тип Опис
$a0 вхідні дані ціле число початкова кількість пляшок
$a1 вхідні дані ціле число кількість, яку знімають
$a2 вхідні/вихідні дані адреса рядок тексту вихідних даних, що завершується нульовим символом
$t0-9 тимчасовий будь-який для тимчасового зберігання

Джерело

WikipediaПосилання відкривається в новому вікні або вкладці
Редагувати через GitHub Посилання відкривається в новому вікні або вкладці
MIPS Assembly Exercism

Час розпочати Пісня про пляшки?

Зареєструйтеся на Exercism, щоб вивчати й опановувати MIPS Assembly, а також 70 вправ та справжнє наставництво від людей, і все це безкоштовно.