SHARE
TWEET

Untitled

a guest Sep 11th, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. arq = open("in.txt", 'r')
  2.  
  3. arqSaida = open("out.txt", 'w+')
  4.  
  5. linhas = arq.readlines()
  6.  
  7.  
  8.  
  9. for linha in linhas:
  10.     y = ''
  11.     x = linha.split()
  12.    
  13.     for i in range(len(x)):
  14.         x[i] = int(x[i])
  15.    
  16.     x.sort()
  17.    
  18.     for i in range(len(x)):
  19.         y = y + str(x[i])
  20.         if i < len(x)-1:
  21.             y = y + ' '
  22.     print(y)
  23.     arqSaida.write(y + '\n')
  24.  
  25. arq.close()
  26. arqSaida.close()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top