+ 3
Help please with this code.
int main () { int a[6][7]; for (int x = 0; x < 6; x++ ){ cin >> a[x]; } for (int y = 0; y < 7; y++){ cin >> a[y]; } return 0; }
3 odpowiedzi
+ 12
You have a 2D array, but you're operating it the 1D way. In order to fill it up, you have to combine two loops.
int main ()
{
    int a[6][7];
    for (int x = 0; x < 6; x++ ){
         for (int y = 0; y < 7; y++){
              cin >> a[x][y];
         }
    }
    return 0;
}
+ 4
what's the problem?
+ 2
thx, it helps.



