title: C++ - input a series of 1s and 0s. Then automatically assign to the corresponding position in a 2D array
body: <p>I am writing a coin flip program and i want the user to input a series of numbers as below</p>
  
  <p>1.input 2 numbers x and y as the number of rows and number of columns(Done)</p>
  
  <p>2.input the initial state of the coins with 1(head) and 2(tail) like below:</p>
  
  <pre><code>1010
  1111
  0000
  </code></pre>
  
  <p>3.Taking the step 2's input and assign the 1s and 0s to the corresponding position in the 2D array as below</p>
  
  <pre><code>1(grid[0][0])0(grid[0][1])...
  1(grid[1][0])1{grid[1][1])...
  ...
  </code></pre>
  
  <p>For 3, is it possible to do so? What i have done now is asking the user to input the numbers 1 by 1 as the below code shows.</p>
  
  <pre><code>for(int x=0;x&lt;rows;x++)
  {
      for(int y=0;y&lt;columns;y++)
      {
          cin &gt;&gt; grid[x][y];
      }
  }
  </code></pre>
  
  <p>Is it possible to read the position of the 1s and 0s using function like "char.at()" or any other advise?</p>