Add everything I got
This commit is contained in:
26
1b.sh
Executable file
26
1b.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
max1=0
|
||||
max2=0
|
||||
max3=0
|
||||
c=0
|
||||
|
||||
while read a; do
|
||||
if [[ -n "$a" ]]; then
|
||||
let c+=$a
|
||||
else
|
||||
if [[ $c -gt $max1 ]]; then
|
||||
max3=$max2
|
||||
max2=$max1
|
||||
max1=$c
|
||||
elif [[ $c -gt $max2 ]]; then
|
||||
max3=$max2
|
||||
max2=$c
|
||||
elif [[ $c -gt $max3 ]]; then
|
||||
max3=$c
|
||||
fi
|
||||
c=0
|
||||
fi
|
||||
done
|
||||
|
||||
echo $(( $max1 + $max2 + $max3 ))
|
||||
Reference in New Issue
Block a user