📄 aar_maxima_add.c
字号:
/* .c freeware http://groups.yahoo.com/group/mathc/
*/
/* --------------------------------- INCLUDES ------------------------------- */
#include "v_ahfile.h"
/* ------------------------------------- FUNCTION -------------------------- */
/* Do : */
/* */
/* -------------------------------------------------------------------------- */
void AplsB(int n,int p)
{
mR mA ={n,p,init_mR(n,p)};
mR mB ={n,p,init_mR(n,p)};
mR mAplsB={n,p,init_mR(n,p)};
/*-------------------------------- PROGRAM ---------------------------------- */
rnd_mR(&mA,9);
rnd_mR(&mB,9);
clrscrn();
printf(" Copy/Past into the maxima windows \n\n");
printf(" kill(all); \n\n");
p_mR_maxima(&mA,"a");
printf("\n");
p_mR_maxima(&mB,"b");
printf(" a+b; \n\n");
getchar();
clrscrn();
printf(" A :");
p_mR(&mA);
printf(" B :");
p_mR(&mB);
add_mR( &mA,&mB,&mAplsB);
printf(" A + B :");
p_mR(&mAplsB);
free(mA.pb);
free(mB.pb);
free(mAplsB.pb);
}
void hello(void)
{
printf("\n Freeware by : xhunga bernard 06000 Nice France.\n");
printf("\n ");
printf("\n Add two matrices ");
printf("\n **************** \n");
printf("\n The size of mA, mB, mAB : 1x1 ... 6x6. \n");
printf("\n ex : \"aplsbi.exe\" \n");
printf("\n You can choose the size : \n");
printf("\n ex : \"aplsbf.exe 2 3\" -> 2x3 ");
printf("\n \"aplsbf.exe 1 5\" -> 1x5 ");
printf("\n \"aplsbf.exe 4 2\" -> 4x2 ");
printf("\n \"aplsbf.exe 5 5\" -> 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;
int p;
/*-------------------------------- PROGRAM ---------------------------------- */
srand(time(&t));
hello();
do
{
if( argc == 3 && atoi(argv[1])&& atoi(argv[2]))
{n = atoi(argv[1]); if( n > 6){n=6;}
p = atoi(argv[2]); if( p > 6){p=6;}}
else
{ n=rndp_I(6); p=rndp_I(6); }
if(n<1){n=1;} if(p<1){p=1;}
AplsB(n,p);
printf("\n Press 'X' Return to stop\n");
} while(toupper(getchar())!='X');
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -