#include<iostream>
using namespace std;
int a[50][50];
void my_cin(int* p)
{
cout << "这是一个50x50的int型数组,请合法输入数据(注:若所有数据一起输入,每上一行最后一个和下一行第一个要有间隔符):\n";
int i, j;
for (i = 0; i < 50 ; i++)
{
for (j = 0; j < 50; j++)
{
cout << "请输入第" << i+1 << "行第" << j+1 << "个:";
cin >> *p++;
}
}
return;
}
void my_out(int* p)
{
cout << "这是数据的输出:\n";
int i, j ;
for (i = 0; i < 50; i++)
{
for (j = 0; j < 50; j++)
{
cout << "a[" << i << "][" << j << "]=" << *p++<<"\t";
}
cout << endl;
}
return;
}
int main()
{
int* P = &a[0][0];
my_cin(P);
my_out(P);
return 0;
}
11-11
1395
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-17
2011
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)