1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#include <iostream>
#include <string>
using namespace std;
void changeNum (int qArray2D [5][5]);
void printNum (int qArray2D [5][5]);
void calcNum (int qArray2D [5][5], int sum);
int main (){
int qArray2D [5][5] = {
{0.0, 0.1, 0.2, 0.3, 0.4},
{1.0, 1.1, 1.2, 1.3, 1.4},
{2.0, 2.1, 2.2, 2.3, 2.4,},
{3.0, 3.1, 3.2, 3.3, 3.4},
{4.0, 4.1, 4.2, 4.3, 4.4}
};
system ("pause");
return 0;
}
void changeNum (int qArray2D [5][5]){
qArray2D [2][1] = 8.5;
}
void printNum (int qArray2D [5][5]){
for (int i = 0; i < 5; i++){
for (int j = 0; j < 5; j++){
cout << qArray2D [i][j] << endl;
}
}
}
void calcNum (int qArray2D [5][5], int sum){
int sum = 0;
for (int a = 0; a < 5; a++)
sum =
|