Created
September 13, 2021 18:11
-
-
Save espinz/1d6a765b34abc83568dafe45f3f3fe75 to your computer and use it in GitHub Desktop.
How many hotdogs for 26 contestants if each eat 2 after the first.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOTDOGS(){ | |
for i in {1..26};do | |
a=$((i-1)) | |
b=$((i+a)) | |
let c+='b' | |
printf %s "$b " | |
done | |
} | |
echo | |
echo "Hotdogs eaten:" | |
HOTDOGS | |
echo | |
echo | |
echo "Total hotdogs:" | |
echo "$c" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment