|  | 
|  | 
| back to board | Python Что не так в коде? Posted by FY0u11  14 Mar 2017 01:17from re import *from math import sqrt
 
 result = findall('[0-9]+', input())
 result.reverse()
 
 for i in result:
 print('{:.4f}'.format(sqrt(int(i))))
 
 Edited by author 14.03.2017 01:20
Re: Python Что не так в коде? For the most tasks WA1 means your program can't even solve sample. Have you tried to run it locally? It's clearly visible it doesn't work.  Here's my run:http://ideone.com/T9g8rU There is only 2 numbers in output so your program processed first input line only. Edited by author 17.03.2017 14:35Re: Python Что не так в коде? Hey admins! His code works well as my, but it doesn't pass on your side.
 As the prove look bellow:
 
 "
 with open('/tmp/123.txt', 'r') as f:
 string = f.read()
 
 from re import *
 from math import sqrt
 
 result = findall('[0-9]+', string)
 result.reverse()
 
 for i in result:
 print('{:.4f}'.format(sqrt(int(i))))
 "
 Answer
 "
 runfile('/home/ant/.config/spyder-py3/temp.py', wdir='/home/ant/.config/spyder-py3')
 2297.0716
 936297014.1164
 0.0000
 37.7757
 "
 
 You have mistakes in comparation analysis on your side.
Re: Python Что не так в коде? Posted by Denis  4 Oct 2017 22:17Hi, master8282 please, take a look at rules: В решениях задач запрещается: работа с любыми файлами; ... (Source: http://acm.timus.ru/help.aspx?topic=judge) here is the problem, since your code based on file reading. | 
 | 
|