Jorell_Ramos_Sinaga

Untitled

Dec 19th, 2021 (edited)
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. soma = 0
  2. j=0
  3. while j != 1:
  4. M,N = input().split(" ")
  5. M = int(M)
  6. N = int(N)
  7. soma = 0
  8. if M > N:
  9. aux = M
  10. M = N
  11. N = aux
  12. if M<=0 or N<=0:
  13. j = 1
  14. if j!=1:
  15. for i in range(M,N+1):
  16. print('%d '%(i),end="")
  17. soma+=i
  18. if i == N:
  19. print('Sum=%d'%(soma))
Add Comment
Please, Sign In to add comment