Commit 70ab891f authored by Kittipong Maneewong's avatar Kittipong Maneewong

ส่งงาน week05 คับ

parent 12284a46
...@@ -4,4 +4,21 @@ def ge(A,b): ...@@ -4,4 +4,21 @@ def ge(A,b):
pass pass
def solve(A,b): def solve(A,b):
pass import numpy.linalg
result=numpy.linalg.solve(A,b)
for i,x in zip(range(len(result)),result):
print ('$x_{} = {}'.format(i,x))
#5x3x1
m,n,_ = map(int,input().split('x'))
print(m,n)
#รับ A
A=[]
for row in range(m):
#2,3,1,4,7
A.append(list(map(int,input().split(','))))
print(n,_)
#รับ b
b = list(map(int,input().split(',')))
#ตอนนี้ มี A กับ b แล้ว
solve(A,b)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment