Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # _*_ coding: utf-8 _*_
- a = list(map(int, input().split()))
- n = len(a)
- count = 0
- for i in range (n - 1):
- for j in range (n - 1 - i):
- if a[j] > a[j + 1]:
- a[j], a[j + 1] = a[j + 1], a[j]
- count += 1
- print(a)
- print(count)
Advertisement
Add Comment
Please, Sign In to add comment