Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (( i=0; i<N-1; i++ )); do
- tmp=$(( sorted_array[i+1] - sorted_array[i] ));
- if [ $tmp < $result ]; then result=$tmp fi
- done
- /tmp/Answer.sh: line 42: syntax error near unexpected token `done'at Answer.sh. on line 42
- /tmp/Answer.sh: line 42: `done' at Answer.sh. on line 42
- for (( i=0; i<N-1; i++ )); do
- tmp=$(( sorted_array[i+1] - sorted_array[i] ))
- if [ "$tmp" -lt "$result" ]; then result=$tmp; fi
- done
- for (( i=0; i<N-1; i++ )); do
- tmp=$(( sorted_array[i+1] - sorted_array[i] ))
- [ $tmp -lt $result ] && result=$tmp
- done
- for (( i=0; i<N-1; i++ ))
- do
- tmp=$(( sorted_array[i+1] - sorted_array[i] ))
- if [ $tmp -lt $result ]
- then
- result=$tmp
- fi
- done
- for (( i=0; i<N-1; i++ )); do
- tmp=$(( sorted_array[i+1] - sorted_array[i] ))
- if [ $tmp -lt $result ]; then result=$tmp; fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement