Initial Commit
This commit is contained in:
Executable
+20
@@ -0,0 +1,20 @@
|
||||
main()
|
||||
|
||||
def fact( n )
|
||||
|
||||
if lt(n 1)
|
||||
return 1
|
||||
else
|
||||
temp = fact( n-1 )
|
||||
return n * temp
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def main()
|
||||
|
||||
"enter n: "
|
||||
n = input()
|
||||
print( fact(n) )
|
||||
|
||||
end
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
main()
|
||||
|
||||
def main()
|
||||
|
||||
"enter a:"
|
||||
|
||||
a = input()
|
||||
|
||||
"enter b:"
|
||||
b = input()
|
||||
|
||||
"enter c:"
|
||||
c = input()
|
||||
|
||||
disc = pow(b,2) - 4*a*c
|
||||
|
||||
x1 = (-b - sqrt(disc) ) / (2*a)
|
||||
x2 = (-b + sqrt(disc) ) / (2*a)
|
||||
|
||||
"x1: " print(x1) "\n"
|
||||
"x2: " print(x2 ) "\n"
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user