雅克比迭代法
#include<iostream>
#include"math.h"
using namespace std;
#define n 6
double a[6][6]={
{
4,-1,0,-1,0,0},{
-1,4,-1,0,-1,0},{
0,-1,4,-1,0,-1},{
-1,0,-1,4,-1,0},{
0,-1,0,-1,4,-1},{
0,0,-1,0,-1,4}},b[n]={
0,5,-2,5,-2,6}, x[n]={
0,5,-2,5,-2,6}, c[n];