📄 aar_octave_scilab_sub.c
字号:
/* .c freeware http://groups.yahoo.com/group/mathc/
*/
/* --------------------------------- INCLUDES ------------------------------- */
#include "v_ahfile.h"
/* ------------------------------------- FUNCTION -------------------------- */
/* Do : */
/* */
/* -------------------------------------------------------------------------- */
void AmnsB(int n,int p)
{
mR mA ={n,p,init_mR(n,p)};
mR mB ={n,p,init_mR(n,p)};
mR mAmnsB={n,p,init_mR(n,p)};
/*-------------------------------- PROGRAM ---------------------------------- */
rnd_mR(&mA,9);
rnd_mR(&mB,9);
clrscrn();
printf(" Copy/Past into the octave/scilab windows \n\n");
p_mR_octave(&mA,"a");
p_mR_octave(&mB,"b");
printf(" a-b\n\n\n");
getchar();
sub_mR(&mA,&mB,&mAmnsB);
p_mR( &mAmnsB);
free(mA.pb);
free(mB.pb);
free(mAmnsB.pb);
}
void hello(void)
{
printf("\n Freeware by : xhunga bernard 06000 Nice France.\n");
printf("\n ");
printf("\n subtract two matrices ");
printf("\n ********************* \n");
printf("\n The size of mA, mB, mAB : 1x1 ... 6x6. \n");
printf("\n ex : \"submRR.exe\" \n");
printf("\n You can choose the size : \n");
printf("\n ex : \"submRR.exe 2 3\" -> 2x3 ");
printf("\n \"submRR.exe 1 5\" -> 1x5 ");
printf("\n \"submRR.exe 4 2\" -> 4x2 ");
printf("\n \"submRR.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;}
AmnsB(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 + -