title: Football tournament with matrix
body: <p>I'm trying to make a football tournament in C++, in which the user inputs the name of the teams(8 teams) and then each team has to play with the other one 1 time. Firstly, I don't know how to read the team names, I mean I tried to use .getline or just cin of a char array, but then I need to put the teams into the matrix and after the final game my program should print the table. So there's the first question: how to read the names and basically make the program think they are numbers or does it work with just with names, no need to use int? And then the users inputs the result for every game, but here comes the hard part. After all the results have been introduced, the matrix rotates cyclic and then the result stored in the variables(you will see in code victory/losses) overwrites themselves, so at the end, I cannot print the right table. So that's the second question: How can I make them store to the right 'team' while they rotate? Sorry if I didn't quite explain very well how it works, hope you understand it. Cheers!</p>
  
  <pre><code>
   // FOOTBALL TOURNAMENT
  
      int map[2][4];
      for (int i = 0; i &lt; 2; i++) {
          for (int j = 0; j &lt; 4; j++) {
              cout &lt;&lt; "map[" &lt;&lt; i &lt;&lt; "][" &lt;&lt; j &lt;&lt; "]= ";
              cin &gt;&gt; map[i][j];
          }
      }
      cout &lt;&lt; "The map looks like this:" &lt;&lt; endl;
      for (int i = 0; i &lt; 2; i++) {
          for (int j = 0; j &lt; 4; j++) {
              cout &lt;&lt; map[i][j] &lt;&lt; " ";
          }
          cout &lt;&lt; endl;
      }
  
              map[0][0] = 1;
              int temp = 0, temp2 = 0, temp3 = 0, temp4 = 0, temp5 = 0, temp6 = 0;
              int a, b, c, d, e, f, g, h, round = 0;
              int victory_m00(0), losses_m10(0), victory_m10(0), losses_m00(0), victory_m01(0), losses_m11(0), victory_m11(0), losses_m01(0);
              int victory_m02(0), losses_m12(0), victory_m12(0), losses_m02(0), victory_m03(0), losses_m13(0), victory_m13(0), losses_m03(0);
              do
              {
                  // Insert result for every game
  
                  cout &lt;&lt; "Enter the result of the first game between " &lt;&lt; map[0][0] &lt;&lt; " vs. " &lt;&lt; map[1][0] &lt;&lt; endl;
                  cin &gt;&gt; a &gt;&gt; b;
                  if (a &gt; b) {
                      victory_m00++;
                      losses_m10++;
                  }
                  else if (a &lt; b)
                  {
                      victory_m10++;
                      losses_m00++;
                  }
                  cout &lt;&lt; "Enter the result of the first game between: " &lt;&lt; map[0][1] &lt;&lt; " vs. " &lt;&lt; map[1][1] &lt;&lt; endl;
                  cin &gt;&gt; c &gt;&gt; d;
                  if (c &gt; d) {
                      victory_m01++;
                      losses_m11++;
                  }
                  else if (c &lt; d)
                  {
                      victory_m11++;
                      losses_m01++;
                  }
  
                  cout &lt;&lt; "Enter the result of the first game between: " &lt;&lt; map[0][2] &lt;&lt; " vs. " &lt;&lt; map[1][2] &lt;&lt; endl;
                  cin &gt;&gt; e &gt;&gt; f;
                  if (e &gt; f) {
                      victory_m02++;
                      losses_m12++;
                  }
                  else if (e &lt; f)
                  {
                      victory_m12++;
                      losses_m02++;
                  }
  
                  cout &lt;&lt; "Enter the result of the first game between: " &lt;&lt; map[0][3] &lt;&lt; " vs. " &lt;&lt; map[1][3] &lt;&lt; endl;
                  cin &gt;&gt; g &gt;&gt; h;
                  if (g &gt; h) {
                      victory_m03++;
                      losses_m13++;
                  }
                  else if (g &lt; h)
                  {
                      victory_m13++;
                      losses_m03++;
                  }
                  round++;
  
  
                  // Map switching
  
                  temp = map[1][0];
                  map[1][0] = map[0][1];
                  temp2 = map[1][1];
                  map[1][1] = temp;
                  temp3 = map[1][2];
                  map[1][2] = temp2;
                  temp4 = map[1][3];
                  map[1][3] = temp3;
                  temp5 = map[0][3];
                  map[0][3] = temp4;
                  temp6 = map[0][2];
                  map[0][2] = temp5;
                  map[0][1] = temp6;
  
                  // Table calculating and printing  ~ also this has to be outside the loop (but at first i wanted to print the table after every 'round'
  
                  cout &lt;&lt; "This is how the table looks like after the " &lt;&lt; round &lt;&lt; " round: \n";
                  cout &lt;&lt; map[0][0] &lt;&lt; " has: " &lt;&lt; victory_m00 &lt;&lt; " victory(-ies) and " &lt;&lt; losses_m00 &lt;&lt; " loss-es!\n";
                  cout &lt;&lt; map[0][1] &lt;&lt; " has: " &lt;&lt; victory_m01 &lt;&lt; " victory(-ies) and " &lt;&lt; losses_m01 &lt;&lt; " loss-es!\n";
                  cout &lt;&lt; map[0][2] &lt;&lt; " has: " &lt;&lt; victory_m02 &lt;&lt; " victory(-ies) and " &lt;&lt; losses_m02 &lt;&lt; " loss-es!\n";
                  cout &lt;&lt; map[0][3] &lt;&lt; " has: " &lt;&lt; victory_m03 &lt;&lt; " victory(-ies) and " &lt;&lt; losses_m03 &lt;&lt; " loss-es!\n";
                  cout &lt;&lt; map[1][0] &lt;&lt; " has: " &lt;&lt; victory_m10 &lt;&lt; " victory(-ies) and " &lt;&lt; losses_m10 &lt;&lt; " loss-es!\n";
                  cout &lt;&lt; map[1][1] &lt;&lt; " has: " &lt;&lt; victory_m11 &lt;&lt; " victory(-ies) and " &lt;&lt; losses_m11 &lt;&lt; " loss-es!\n";
                  cout &lt;&lt; map[1][2] &lt;&lt; " has: " &lt;&lt; victory_m12 &lt;&lt; " victory(-ies) and " &lt;&lt; losses_m12 &lt;&lt; " loss-es!\n";
                  cout &lt;&lt; map[1][3] &lt;&lt; " has: " &lt;&lt; victory_m13 &lt;&lt; " victory(-ies) and " &lt;&lt; losses_m13 &lt;&lt; " loss-es!\n";
                  cout &lt;&lt; endl;
                  cout &lt;&lt; endl;
  
  
              } while (map[0][1] != 2);
  
              ```
  
  </code></pre>