промежутое
This commit is contained in:
35
programm9.py
Normal file
35
programm9.py
Normal file
@@ -0,0 +1,35 @@
|
||||
f = open('INPUT.TXT')
|
||||
a, b, c = map(int, f.readline().split())
|
||||
f.close()
|
||||
|
||||
result = ""
|
||||
|
||||
if a == 0 and b == 0 and c == 0:
|
||||
result = "0"
|
||||
else:
|
||||
if a != 0:
|
||||
result += str(a)
|
||||
|
||||
if b != 0:
|
||||
if b > 0 and result:
|
||||
result += "+"
|
||||
if b == 1:
|
||||
result += "x"
|
||||
elif b == -1:
|
||||
result += "-x"
|
||||
else:
|
||||
result += str(b) + "x"
|
||||
|
||||
if c != 0:
|
||||
if c > 0 and result:
|
||||
result += "+"
|
||||
if c == 1:
|
||||
result += "y"
|
||||
elif c == -1:
|
||||
result += "-y"
|
||||
else:
|
||||
result += str(c) + "y"
|
||||
|
||||
f = open('OUTPUT.TXT', 'w')
|
||||
f.write(result)
|
||||
f.close()
|
||||
Reference in New Issue
Block a user