For example, if the user enters:
0,3,4,0,0,7,6,7
the program should create following board and print:
Q.......
...Q....
....Q...
Q.......
Q.......
.......Q
......Q.
.......Q
i am getting the right answer it just only lets me do it once at a time for example i enter 0 and it prints the first line right away and then tells me to enter the second number but i want to enter all 7 numbers at once then it should print out the chess board anyone know what i can do thanks
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <iostream>
usingnamespace std;
int main(){
int x [8];
cout << " Enter only whole numbers between 1 and 7 " << endl;
for( int c = 0; c <= 7; c++){
cin >> x [c];
for( int r = 0; r <= 7; r++)
if( r == x[c]) cout << " Q " ;
else cout << " . " ;
cout << endl;
}
return 0;
}