blob: 9548b1d6a37004d6409706417802599de997233b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
#!/bin/sh
gcd2() {
if test $2 = 0 ; then
echo $1
else
gcd2 $2 `expr $1 % $2`
fi
}
gcdn() {
r=$1; shift
for n in $*; do
r=`gcd2 $r $n`
done
echo $r
}
gcdn $*
|