📄 aar_trace_r.c
字号:
/* .h freeware http://groups.yahoo.com/group/mathc/ */
/* --------------------------------- INCLUDES ------------------------------- */
#include "v_ahfile.h"
/* ------------------------------------- FUNCTION -------------------------- */
/* Do : */
/* */
/* -------------------------------------------------------------------------- */
void traceA(int n)
{
mR mA ={n,n,init_mR(n,n)};
/*-------------------------------- PROGRAM ---------------------------------- */
rnd_mR(&mA,9);
clrscrn();
printf(" A"); p_mR(&mA);
printf("\n\n\n Trace of the matrix A = %10.1f\n\n\n", trace_mR(&mA));
free( mA.pb);
}
void hello(void)
{
printf("\n Freeware by : xhunga bernard 06000 Nice France.\n");
printf("\n ");
printf("\n Find the trace of mA ");
printf("\n ******************** \n");
printf("\n The size of mA : 2x2 ... 5x5. \n");
printf("\n ex : \"tracef.exe\" \n");
printf("\n You can choose the size : \n");
printf("\n ex : \"tracef.exe 2\" -> mA 2x2 ");
printf("\n \"tracef.exe 3\" -> mA 3x3 ");
printf("\n \"tracef.exe 4\" -> mA 4x4 ");
printf("\n \"tracef.exe 5\" -> mA 5x5 ");
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;}
traceA(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 + -