exo_fibo.sh 181 Bytes
Newer Older
Romain De Laage De Bellefaye's avatar
Romain De Laage De Bellefaye committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /usr/bin/bash

echo "Entrer un rang n : "
read n

u0=0
u1=1

echo "u0 = $u0"
echo "u1 = $u1"

for i in $(seq 2 $n)
do
	u2=$(($u0 + $u1))

	echo "u$i = $u2"

	u0=$u1
	u1=$u2
done