好吧基本上我希望这个代码让用户每次都输入一个值到数组中,然后他们可以指定行数和列数.我想我的问题是,每次用户输入值时,它进入正确的列,但也进入两行,所以最后它只打印出用户在所有行中输入的最后一批数字.
很抱歉,如果这很难理解,因为这是我在本网站的第一篇文章,你可能会说我只是在学习c ++.所以,如果你能提供帮助,我们将不胜感激.
#include <iostream>
using namespace std;
int main()
{
int row;
int column;
int value[row][column];
cout << "How Many Rows?\n";
cin >> row;
cout << "How Many Columns\n";
cin >> column;
for(int x = 0; x<row; x++) {
for(int y = 0; y<column; y++) {
cout << "Enter Value Now\n";
cin >> value[x][y];
}
cout << endl;
}
cout << endl;
for(int a = 0; a < row; a++) {
for(int b = 0; b < column; b++) …Run Code Online (Sandbox Code Playgroud)