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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
#include<iostream>
#include<cstdlib>
#include<string>
#include<iomanip>
using namespace std;
int main()
{
int i,j,q,p;
string board[8][8];
string top1,top2,kralj1,kralj2;
int A,B;
string file[8]={"1","2","3","4","5","6","7","8"};
string rank[8]={"A","B","C","D","E","F","G","H"};
for(i=0;i<8;i++){
for(j=0;j<8;j++){
board[i][j]=rank[i]+file[j];
}
}
getline(cin,top1);
getline(cin,top2);
getline(cin,kralj1);
getline(cin,kralj2);
for(i=0;i<8;i++){
for(j=0;j<8;j++){
if((board[i][j]==top1)||(board[i][j]==top2))
{
for(int q=i;q<i+1;q++)
{
for(int p=0;p<8;p++)
{
board[q][p]="1";
}
}
for(q=i;q<8;q++)
{
for(p=j;p<j+1;p++)
{
board[q][p]="1";
}
}
}
}
}
for(i=0;i<8;i++){
for(j=0;j<8;j++){
cout<<board[i][j]<<setw(3);
}
cout<<endl;
}
system("PAUSE");
return 0;
}
|