Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void cheotroicot(float a[][],float b[],int n) {
- int i,j,t;
- float q,tongcot;
- /* scanf("%d",&n); // nhap n
- for (i=0;i<n;i++) // lay he pt
- for (j=0;j<=n;j++){
- if (j==n) scanf("%lf",&b[i])
- else scanf("%lf",&a[i][j]);}
- */
- for(j=0;j<n;j++){ // doi A sang B,b
- b[j] = b[j] / a[j][j];
- for(i=0;i<n;i++){
- a[i][j] = -a[i][j]/a[j][j];
- }
- }
- for (i=0;i<n;i++)
- a[i][i] = 0;
- t=1;// 1 la chuan 1
- q=0;// q la he so co
- for ( j=1; j<n;j++){
- tongcot=0;
- for ( i=1;i<n;i++){
- tongcot+=fabs(a[i][j]);
- }
- if(q<tongcot){
- q=tongcot;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement