Skip to content

Instantly share code, notes, and snippets.

@kolodziej
Created January 26, 2014 13:04
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kolodziej/8632374 to your computer and use it in GitHub Desktop.
#!/bin/bash
a=$1
b=$2
c=$3
istnieje=true
if [ $(($a+$b)) -le $c ]; then
echo "Warunek $a + $b > $c nie jest spełniony!"
istnieje=false
fi
if [ $(($b+$c)) -le $a ]; then
echo "Warunek $b + $c > $a nie jest spełniony!"
istnieje=false
fi
if [ $(($c+$a)) -le $b ]; then
echo "Warunek $c + $a > $b nie jest spełniony!"
istnieje=false
fi
if $istnieje; then
echo "Trójkąt o bokach $a, $b i $c istnieje!"
else
echo "Trójkąt o bokach $a, $b i $c nie istnieje!"
fi
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment