forked from kalmar/DALGLI0
input z lini poleceń
This commit is contained in:
parent
1d1b6f026a
commit
3feef9f4af
11
zad2.py
11
zad2.py
@ -1,3 +1,6 @@
|
|||||||
|
import sys
|
||||||
|
import ast
|
||||||
|
|
||||||
def modulo(x,n):
|
def modulo(x,n):
|
||||||
for i in range(len(x)):
|
for i in range(len(x)):
|
||||||
x[i] = x[i] % n
|
x[i] = x[i] % n
|
||||||
@ -56,10 +59,10 @@ def nwd(a,b,n):
|
|||||||
return modulo(a,n)
|
return modulo(a,n)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
n = int(input("Podaj n: "))
|
n = int(sys.argv[1])
|
||||||
print("R[x] dla R = Z/"+str(n))
|
f = ast.literal_eval(sys.argv[2])
|
||||||
f = eval(input("Podaj f w formacie listy np: [1,1, 0,1]: "))
|
g = ast.literal_eval(sys.argv[3])
|
||||||
g = eval(input("Podaj f w formacie listy np: [1, 1,0,1]: "))
|
|
||||||
print(iloczyn(f,g,n))
|
print(iloczyn(f,g,n))
|
||||||
print(klasaReszt(f,g,n))
|
print(klasaReszt(f,g,n))
|
||||||
print(nwd(f,g,n))
|
print(nwd(f,g,n))
|
||||||
|
Loading…
Reference in New Issue
Block a user