top
logo

ចំនួនអ្នកទស្សនា

033339
Today97
Yesterday130
This Week600
This Month1174
All Days33339
38.107.191.85
US


លេខទូរស័ព្ទសង្គ្រោះបន្ទាន់ មន្ទីរពេទ្យសាធារណៈនៅភ្នំពេញ
d

១. រថយន្តសាមុយ មន្ទីរពេទ្យ​កាល់ម៉ែត= 119
២. រថយន្តសង្គ្រោះ មន្ទីរពេទ្យ​រុស្ស៊ី= 023 217 764
= វិទ្យុទាក់ទង (151940)
៣. រថយន្តសង្គ្រោះ មន្ទីរពេទ្យ​ព្រះសង្ឃ= 016 909 774
៤. លេខប្រចាំការ (Hot Line) គ្រុនផ្ដាសាយ A(H1N1)= 012 488 981
= 012 836 868

Pseudocode for N-Variable System Linear Equation (for VB2008) បោះពុម្ភ  សារអេឡិចត្រូនិច
សរសេរដោយ Setha IECH   
អាទិត្យ, 23 ឧសភា 2010 13:54

    

  • Identify Output
    x1, x2, x3, ………, xn
     
  • Determine Input
    b1, b2, b3, ………, bn
    a11, a12, a13, ………., a1n
    a21, a22, a23, ………., a2n
    ………………
    an1, an2, an3, ………., ann
     
  • Determine Process
    Declare n as Integer
    Input value of n
    Declare a(1 to n,1 to n), b(1 to n), DetD, DetDx(1 to n), x(1 to n) As Double
    Declare temp(1 to n) As Double
    Declare i, j As Integer
     
    For i=1 to n increased by 1
       For j=1 to n increased by 1
          input value of a(i, j)
       End For
       input value of b(i)
    End for
     
    DetD = CalculateDet (n, a)
     
    For i=1 to n increased by 1
       For j=1 to n increased by 1
          temp (j) = a (j, i)
          a(j, i) = b(j)
       End For
       DetDx(i) = CalculateDet (n , a)
     
       If DetD=0 Then
          If DetDx(i)=0 then
             Display Message “Infinite root!”
          Else
             Display Message “No root!”
          End If
          Exit For
       End If

       x(i) = DetDx(i)/DetD
       Display x(i)

       For j=1 to n increased by 1
          a(j, i) = temp (j)
       End for
    End of For
     
Function CalculateDet
  • Function CalculateDet
       Parameters pass in: n and a(1 to n, 1 to n)
       Declare Det As Integer
     
       If n = 2 Then
          Det = a(1, 1) * a(2, 2) – a(2, 1) * a(1, 2)
       Else
          Declare temp(1 to n-1, 1 to n-1) As Double
          Declare Coef, m, k, j, i As Integer
          Det = 0 
          For i = 1 to n increased by 1
             For j=2 to n increased by 1
                m = 1 
                For k=1 to n increased by 1
                   If k ! = i Then
                      temp(m, j-1) = a(k, j) 
                      m = m + 1 
                    End If
                 End For 
              End For 

              If i modulus 2 = 0 Then
                 Coef = -1
              Else
                 Coef = 1 
              End If
              Det = Det + Coef * a(i, 1) * CalculateDet (n-1, temp)
           End For
        End If
     
        Return Value of Det
    End Function
 

bottom
top
bottom

ផលិតដោយ krookroo.com.