⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 Jacobi GaussSeidel法求算式的根
💻 C
字号:
#include	<stdio.h>
#include<malloc.h>
#include<stdio.h>
#define NULL 0
struct node
{ int data;
int m;
struct node *next;
}sqlist;

void main()
{	
struct node *p,*q,*l;
int i,k,temp,a[10]={4,7,6,3,4,6,8,1,9,3};
l=(struct node *)malloc(sizeof(struct node));
l->next=NULL;l->data=1;l->m=a[0];
p=l;
for(i=2;i<=10;i++)
{q=(struct node *)malloc(sizeof(struct node));
q->data=i;q->m=a[i-1];
p=q->next;p->next=NULL;}
l=p->next;
temp=a[0];
while(l->next!=l)
{i=0;
while(i!=temp)
{q=p;p=p->next;i++;}
temp=p->m;p->next=q->next;
l=p->next;}
printf("%d%d",l->data,l->m);

}
//#include	<stdio.h>
//#include	<stdlib.h>
//#include	<conio.h>
//#include	<math.h>
//#include"InputandOutput.h"
//#include"Jacobi.h"
//#include"GaussSeidel.h"
//
//void main()
//{	float A[MAX_n][MAX_n],x[MAX_n];
//	int n;
//	printf("\n请输入方程个数 n=");
//	scanf("%d",&n);
//	if(n>=MAX_n-1)exit(0);
//    Matrix(A,n,n+1);
//	if(!Jacobi(A,x,n))	{
//		printf("\nJacobi计算结果:");
//		Output(x,n);
//	}
//    if(!G_S(A,x,n))	{
//		printf("\nG-S计算结果:");
//		Output(x,n);
//	}
//	printf("\n\n按键退出\n");
//	getch();
//}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -