大学生必读的30本书:这道题如何写流程图?c语言流程图

来源:百度文库 编辑:高考问答 时间:2024/04/29 17:39:15
#include"stdio.h"
#define x 2
#define y 2
#define z 2
int a[x][y];
int b[y][z];
int c[x][z];
main()
{ int i,j,k,temp;
clrscr();
printf("please input int matrix a[%d][%d]\n",x,y);
for(i=0;i<x;i++)
for(j=0;j<y;j++)
{
scanf("%d",&temp);
a[i][j]=temp;
}
for(i=0;i<x;i++)
{ for(j=0;j<z;j++)
{for(k=0;k<y;k++)
{c[i][j]+=a[i][k]*b[k][j];
}
}
}
for(i=0;i<x;i++)
{ for(j=0;j<z;j++)
{printf("c[%d][%d]=%d",i+1,j+1,c[i][j]);
}
}
}