1
0
forked from kalmar/DALGLI0

input z lini poleceń

This commit is contained in:
Patryk Jagielski 2018-06-07 09:15:18 +00:00
parent 1d1b6f026a
commit 3feef9f4af

11
zad2.py
View File

@ -1,3 +1,6 @@
import sys
import ast
def modulo(x,n):
for i in range(len(x)):
x[i] = x[i] % n
@ -56,10 +59,10 @@ def nwd(a,b,n):
return modulo(a,n)
def main():
n = int(input("Podaj n: "))
print("R[x] dla R = Z/"+str(n))
f = eval(input("Podaj f w formacie listy np: [1,1, 0,1]: "))
g = eval(input("Podaj f w formacie listy np: [1, 1,0,1]: "))
n = int(sys.argv[1])
f = ast.literal_eval(sys.argv[2])
g = ast.literal_eval(sys.argv[3])
print(iloczyn(f,g,n))
print(klasaReszt(f,g,n))
print(nwd(f,g,n))