小编Ker*_*ter的帖子

Python:如何确定语言?

我想得到这个:

Input text: "???????? ?????"
Output text: "Russian" 

Input text: "??"
Output text: "Chinese" 

Input text: "????"
Output text: "Japanese" 

Input text: "????????????"
Output text: "Arabic" 
Run Code Online (Sandbox Code Playgroud)

我怎么能在python中做到这一点?谢谢.

python string parsing

61
推荐指数
6
解决办法
3万
查看次数

将int转换为char?

ref void init_board (ref int side, ref char[][] board)  //make empty symbol chessboard
{
    const char black = ' ';
    const char white = 0xB0;

    board[0][0] = ' ';
    for (int i = 1; i <= side; i++)
    {
        board[i][0] = 0x30 + i;  //Setting nums; "Error: Cannot convert int to char"
        board[0][i] = 0x40 + i;  //Setting letters; same here
        for (int j = 1; j <= side; j++)
            board[i][j] = (i+j)%2 == 0 ? black : white; //making …
Run Code Online (Sandbox Code Playgroud)

int d char

1
推荐指数
1
解决办法
92
查看次数

标签 统计

char ×1

d ×1

int ×1

parsing ×1

python ×1

string ×1