Advertisement
Guest User

Untitled

a guest
Oct 10th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement