Skip to content

Instantly share code, notes, and snippets.

@thomasw-mitutoyo-ctl
Created March 22, 2022 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasw-mitutoyo-ctl/f031adea08afe8c848cc6cc9a885c9a0 to your computer and use it in GitHub Desktop.
Save thomasw-mitutoyo-ctl/f031adea08afe8c848cc6cc9a885c9a0 to your computer and use it in GitHub Desktop.
Schreibe eine Funktion, die aus einer Liste mit Zahlen die kleinste heraussucht.
void main() {
var liste = [1,5,9,1,0,-5,9];
print(minimum(liste));
}
int minimum(List zahlen)
{
int min = zahlen[0];
for (int zahl in zahlen)
{
if (zahl < min)
{
min = zahl;
}
}
return min;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment