📄 aar_gjfnone.c
字号:
/* .h freeware http://groups.yahoo.com/group/mathc/ */
/* --------------------------------- INCLUDES ------------------------------- */
#include "v_ahfile.h"
/* ------------------------------------- FUNCTION -------------------------- */
/* Do : */
/* */
/* -------------------------------------------------------------------------- */
void gjA(int n)
{
double det;
int x;
int m = n+1;
mR mA ={n,m,init_mR(n,m)};
mR mAT ={n,n,init_mR(n,n)};
/*-------------------------------- PROGRAM ---------------------------------- */
x = 6;
if(n<4){x = 10;}
if(n<3){x = 100;}
clrscrn();
printf("Wait (the determinant must be zero) : ");
do
{
printf("*");
rnd_mR(&mAT,x);
det = det_R(&mAT);
}while(det);
rnd_mR(&mA,x);
copy_mR(&mAT,&mA);
clrscrn();
printf("\n\n System with none or several solutions. \n");
printf(" * No solution if a line is \"0 0 .. 0 1\" \n");
printf(" * Several solutions if a line is \"0 0 .. 0 0\" \n");
printf("\n A");
p_mR(&mA);
printf("\n\n GaussJordan elimination of matrix mA \n");
gaussjordan_mR(&mA);
p_mR(&mA);
free( mA.pb);
free( mAT.pb);
}
void hello(void)
{
printf("\n Freeware by : xhunga bernard 06000 Nice France.\n");
printf("\n ");
printf("\n GaussJordan elimination ");
printf("\n *********************** \n");
printf("\n The size of mA : 2x3 ... 4x5. \n");
printf("\n ex : \"gjf.exe\" \n");
printf("\n You can choose the size : \n");
printf("\n ex : \"gjf.exe 2\" -> mA 2x3 ");
printf("\n \"gjf.exe 3\" -> mA 3x4 ");
printf("\n \"gjf.exe 4\" -> mA 4x5 ");
printf("\n\n ");
printf("\n Distributed by : http://www.simtel.net/ ");
printf("\n ");
printf("\n Press return to continue ");
printf("\n ");
getchar();
}
/* --------------------------------- MAIN ----------------------------------- */
int main(int argc, char *argv[])
{
time_t t;
int n;
/*-------------------------------- PROGRAM ---------------------------------- */
srand(time(&t));
hello();
do
{
if( argc == 2 && atoi(argv[1]))
{ n = atoi(argv[1]); if( n > 5){n=5;}}
else
{ n = rndp_I(5);}
if( n < 2){n=2;}
gjA(n);
printf("\n Press 'X' Return to stop\n");
} while(toupper(getchar())!='X');
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -