Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sum (id, pr, n, a):
- a := array (n)
- count := 0
- i := 0
- j := 0
- k := 0
- for i := 0 until (n - 1):
- for j := (i + 1) until n:
- if (a[i] >= a[j]):
- k := a[j]
- a[j] := a[i]
- a[i] := k
- while (count < n & a[count] < 0):
- count += 1
- if (a[count] > 0):
- print(0)
- else:
- if (count == n):
- print(0)
- else:
- while ((a[count + 1] - a[count]) == 1 | (a[count + 1] == a[count])):
- count += 1
- if (count == n):
- print(a[count - 1] + 1)
- print(a[count] + 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement