4035
10596
17891
5278
11293
#!/bin/bash
### Partie 1 ###
total=0
cat input.txt | while read n; do
if [ -z "$n" ] ; then
echo $total
total=0
else
total=$(($total + $n))
fi
done | sort -n | tail -n 1
### Partie 2 ###
total=0
cat input.txt | while read n; do
if [ -z "$n" ] ; then
echo $total
total=0
else
total=$(($total + $n))
fi
done | sort -n | tail -n 3 | sed 's/^/+ /' | xargs expr 0