Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solve request: #37

Open
ahkazemi2007 opened this issue Sep 20, 2023 · 0 comments
Open

solve request: #37

ahkazemi2007 opened this issue Sep 20, 2023 · 0 comments

Comments

@ahkazemi2007
Copy link

Solve Request

Quera question index:

294

Related Code

a = float(input())
b = float(input())
c = float(input())

delta = b**2 - 4*a*c

if a != 0:
    if delta < 0:
        print("IMPOSSIBLE")
    elif delta == 0:
        x = - (b / (a * 2))
        print("%.3f" % x)
    else:
        x1 = (-b + math.sqrt(delta)) / (a * 2)
        x2 = (-b - math.sqrt(delta)) / (a * 2)
        if x1 > x2:
            print("%.3f" % x2 + "\n" + "%.3f" % x1)
        else:
            print("%.3f" % x1 + "\n" + "%.3f" % x2)
elif b != 0:
    print("%.3f" %  (-c / b))
else:
    print("IMPOSSIBLE")

Additional Context
همه رو درست میده جز یدونه حالت

Compiled Successfully
Test 1
ACCEPTED
Test 2
ACCEPTED
Test 3
ACCEPTED
Test 4
ACCEPTED
Test 5
ACCEPTED
Test 6
ACCEPTED
Test 7
ACCEPTED
Test 8
WRONG ANSWER
Test 9
ACCEPTED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant