문제/Linux

231206 Linux 문제 ⓐ 구구단 출력

잇꼬 2023. 12. 6. 18:02
728x90
반응형
SMALL

vi gugudan.sh

------------------------------------------------
#!/bin/bash

for i in {2..9}
do
        for j in {1..9}
        do
                result=`expr $j \* $i`
                echo "$i * $j =$result"
        done
                echo "                     "
done



[선생님 코드]
for i in {2..9}
do
        echo "* $i 단 *"
        for j in {1..9}
        do
                result=`expr $j \* $i`
                echo "$i * $j =$result"
        done
                echo "                     "
done

------------------------------------------------

728x90
반응형
LIST