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):
|
||||
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))
|
||||
|
Loading…
Reference in New Issue
Block a user