我是菜鸟一只,刚学习C++,遇到了一个问题,不知怎么回事:
#include
#include
using namespace std;
//extern const int Row,Col;
void ShowMatrix(double B[][Col])
{
for(int i=0;i {
for(int j=0;j cout< cout< };
cout< return;
};
double MatrixAvg(double M[][col])
{
double Sum=0;
int i,j;
for(i=0;i for(j=0;j Sum+=M[i][j];
return Sum/double(Row*Col);
};
//void ShowMatrix(double [][Col]);
//double MatrixAvg(double [][Col]);
int main ()
{
const int Row=2;
const int Col=3;
double A[Row][Col]={1.8,4.9,6.8,6.2,2.1,3.4};
cout<<"Êý×éAÊÇ£º"< ShowMatrix(A[Row][Col]);
cout<<"Êý×éAµÄƽ¾ùÖµÊÇ£º"< cout<<"Ö±½Ó½«AµÄÊä³ö½á¹ûÊÇ£º"< return 0;
}
--------------------next---------------------
阅读(1082) | 评论(0) | 转发(0) |