Track
/
MIPS Assembly
MIPS Assembly
/
Esercizi
/
Catena alimentare
Catena alimentare

Catena alimentare

Medio

Istruzioni

Genera il testo della canzone «I Know an Old Lady Who Swallowed a Fly».

Potresti copiare e incollare il testo, oppure leggerlo da un file, ma questo problema è molto più interessante se lo affronti in modo algoritmico.

È una canzone cumulativa di origine sconosciuta.

Questa è una delle tante varianti diffuse.

I know an old lady who swallowed a fly.
I don't know why she swallowed the fly. Perhaps she'll die.

I know an old lady who swallowed a spider.
It wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly. Perhaps she'll die.

I know an old lady who swallowed a bird.
How absurd to swallow a bird!
She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly. Perhaps she'll die.

I know an old lady who swallowed a cat.
Imagine that, to swallow a cat!
She swallowed the cat to catch the bird.
She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly. Perhaps she'll die.

I know an old lady who swallowed a dog.
What a hog, to swallow a dog!
She swallowed the dog to catch the cat.
She swallowed the cat to catch the bird.
She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly. Perhaps she'll die.

I know an old lady who swallowed a goat.
Just opened her throat and swallowed a goat!
She swallowed the goat to catch the dog.
She swallowed the dog to catch the cat.
She swallowed the cat to catch the bird.
She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly. Perhaps she'll die.

I know an old lady who swallowed a cow.
I don't know how she swallowed a cow!
She swallowed the cow to catch the goat.
She swallowed the goat to catch the dog.
She swallowed the dog to catch the cat.
She swallowed the cat to catch the bird.
She swallowed the bird to catch the spider that wriggled and jiggled and tickled inside her.
She swallowed the spider to catch the fly.
I don't know why she swallowed the fly. Perhaps she'll die.

I know an old lady who swallowed a horse.
She's dead, of course!

Formato dell'output

Produci il testo della canzone come una stringa terminata da null.

Registri

Registro Utilizzo Tipo Descrizione
$a0 input intero verso iniziale
$a1 input intero verso finale
$a2 input/output indirizzo stringa di output terminata da null
$t0-9 temporaneo qualsiasi per la memorizzazione temporanea

Fonte

WikipediaIl link si apre in una nuova finestra o scheda
Modifica tramite GitHub Il link si apre in una nuova finestra o scheda
MIPS Assembly Exercism

Vuoi iniziare Catena alimentare?

Iscriviti a Exercism per imparare e padroneggiare MIPS Assembly con 70 esercizi e il mentoring di persone reali, tutto gratis.