我试图用c ++初始化一个tic-tac-toe板,但输出总是给我六进制值.有没有办法将它们转换为实际的字符串值?
#include <iostream>
#include<string>
using namespace std;
int main()
{
string tab[5][5] = { "1","|","2","|","3",
"-","+","-","+","-",
"4","|","5","|","6",
"-","+","-","+","-",
"7","|","8","|","9" };
for(int i = 0; i <= 24; i++)
{
cout << tab[i] << endl;
}
}
Run Code Online (Sandbox Code Playgroud)