Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C language, how to assign a shape number to a string array?
C language, how to assign a shape number to a string array?
# include & ltstdio.h & gt

# include & ltstring.h & gt

void main()

{

Char chessboard [200] = "01234567";

char squares[ 100][ 100]= { 0 };

char a[2]= { 0 };

int row,column

for(row = 0; row & lt8; row++)

{

Strcat (chessboard, "\ n");

//strcat (chessboard, "?" );

A[0]=' 0 '+ line;

Strcat (chessboard, a);

For (column = 0; Column & lt8; Column++)

{

If (square [row] [column])

{

Strcat (chessboard, "#");

}

other

{

Strcat (chessboard, "");

}

}

}

Puts (chessboard);

}

Output:

. 0 1 2 3 4 5 6 7

0 .。 . . . . . .

1 .。 . . . . . .

2 .。 . . . . . .

3 .。 . . . . . .

4 .。 . . . . . .

5 .。 . . . . . .

6 .。 . . . . . .

7 .。 . . . . . .