Advertisement
Qpel

IV atsiskaitymas daugybos lentele

Feb 16th, 2017
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.43 KB | None | 0 0
  1. dialog --title "Daugybos lentele" \
  2. --inputbox "Iveskite skaiciu" 0 0 2>e.txt
  3. kint=$?
  4. sk=`cat e.txt`
  5. case $kint in
  6. 0)
  7.     for ((i = 1; i<=10; i++))
  8.     do
  9.         ats=`expr $i * $sk`
  10.         echo "$i x $sk = $ats" >> a.txt
  11.     done
  12.     dialog --title "Daugybos lentele" \
  13.     --backtitle "$kint" \
  14.     --infobox "`cat a.txt`" 0 0;
  15.     rm -f a.txt
  16.     rm -f e.txt
  17. ;;
  18. 1)
  19.     rm -f a.txt
  20.     rm -f e.txt
  21. exit ;;
  22.  
  23. 255)
  24.     rm -f a.txt
  25.     rm -f e.txt
  26. exit ;;
  27. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement