1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | #include <iostream> using namespace std; void main( int argc, char * argv[]) { srand ( time (NULL)); int mines[5][5], i, j; for (i = 0; i < 5; i++){ for (j = 0; j < 5; j++){ int temp = rand () % 2; cout << temp << endl; mines[i][j] = temp; } } for (i = 0; i < 5; i++){ for (j = 0; j < 5; j++){ cout << mines[i][j] << " " ; } cout << endl; } } |