#include<iostream>
using namespace std;
int f(int b[][4])
{
int i, j, s = 0;
for (j = 0; j < 4; j++)
{
i = j;
if (i > 2) i = 3 - j;
s += b[i][j];
}
return 0;
}
int main()
{
int a[4][4] = { {1,2,3,4},{5,6,7,8},{9,10,11,12},{13,14,15,16} };
cout << f(a) << endl;
return 0;
}
``
#include<iostream>
using namespace std;
double max(double x, double y);
int main()
{
double x, y;
cout << "please enter x,y:";
cin >> x >> y;
cout << max(x, y) << endl;
return 0;
}
double max(double a, double b)
{
return (a > b ? a : b);
}
二维数组
最新推荐文章于 2024-05-14 11:04:08 发布