Kurzusok
/
MIPS Assembly
MIPS Assembly
/
Feladatok
/
Tápláléklánc
Tápláléklánc

Tápláléklánc

Közepes

Utasítások

Írd meg az »I Know an Old Lady Who Swallowed a Fly« című dal szövegét.

Bár a dalszöveget akár be is másolhatnád, vagy beolvashatnád egy fájlból, ez a feladat sokkal érdekesebb, ha algoritmikusan közelíted meg.

Ez egy ismeretlen eredetű kumulatív dal.

Ez a számos gyakori változat egyike.

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!

A kimenet formátuma

A dalszöveget nullával lezárt stringként add ki.

Regiszterek

Regiszter Használat Típus Leírás
$a0 bemenet egész szám kezdő versszak
$a1 bemenet egész szám záró versszak
$a2 bemenet/kimenet cím nullával lezárt kimeneti string
$t0-9 ideiglenes bármi ideiglenes tárolásra

Forrás

WikipediaA hivatkozás új ablakban vagy lapon nyílik meg
Szerkesztés GitHubon A hivatkozás új ablakban vagy lapon nyílik meg
MIPS Assembly Exercism

Készen állsz elkezdeni a(z) Tápláléklánc feladatot?

Iratkozz fel az Exercism-re, hogy megtanuld és elsajátítsd a(z) MIPS Assembly nyelvet 70 feladat segítségével, valódi emberi mentorálással, mindez ingyen.