SHARE
TWEET

Untitled

a guest Oct 10th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void cheotroicot(float a[][],float b[],int n) {
  2.     int i,j,t;
  3.     float q,tongcot;
  4.     /* scanf("%d",&n); // nhap n
  5.     for (i=0;i<n;i++) // lay he pt
  6.         for (j=0;j<=n;j++){
  7.             if (j==n) scanf("%lf",&b[i])
  8.              else scanf("%lf",&a[i][j]);}
  9.     */
  10.     for(j=0;j<n;j++){    // doi A sang B,b
  11.         b[j] = b[j] / a[j][j]; 
  12.         for(i=0;i<n;i++){
  13.             a[i][j] = -a[i][j]/a[j][j];
  14.         }
  15.     }
  16.     for (i=0;i<n;i++)
  17.         a[i][i] = 0;
  18.    
  19.     t=1;// 1 la chuan 1
  20.     q=0;// q la he so co
  21.     for ( j=1; j<n;j++){
  22.         tongcot=0;
  23.         for ( i=1;i<n;i++){
  24.             tongcot+=fabs(a[i][j]);
  25.         }
  26.         if(q<tongcot){
  27.             q=tongcot;
  28.         }
  29.     }  
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top