fork download
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. const unsigned rows = 3 ;
  6. const unsigned cols = 5 ;
  7. for ( unsigned row=0; row < rows; ++row )
  8. for ( unsigned col =0; col < cols; ++col )
  9. std::cout << '(' << row << ',' << col << ") = " << row * cols + col << '\n' ;
  10. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
(0,0) = 0
(0,1) = 1
(0,2) = 2
(0,3) = 3
(0,4) = 4
(1,0) = 5
(1,1) = 6
(1,2) = 7
(1,3) = 8
(1,4) = 9
(2,0) = 10
(2,1) = 11
(2,2) = 12
(2,3) = 13
(2,4) = 14