解決 VS Code輸出字串亂碼問題

2021-10-06 14:06:16 字數 516 閱讀 6351

首先明白vscode其實呼叫的是cmd,我們需要修改的是cmd的編碼格式,我們可以使用chcp命令檢視當前編碼格式。

查了網上的方法,有的只能修改一次,怎麼固定編碼格式呢。

在登錄檔中增加乙個字串值就可以固定cmd的編碼格式了。

win+r鍵 調出

在登錄檔中找到目錄:計算機\hkey_local_machine\software\microsoft\command processor

增加乙個字串值autorun,數值資料 chcp 65001

好了,再開啟vs code就可以愉快的程式設計了。

輸出字串

5.連線字串 半形句號 是字串連線符,可以把兩個字串連線成乙個字串。例如7 5 echo str.url 技巧 我們可以使用字串連線符累加字串。例如7 6 第一句我們給 str賦值,str表示字串 php中文社群位址是 第二句表示在 str的值上累加字串 www.phpnet.cn 所以,str最後...

輸出字串Count and Say

最近研究輸出字串,稍微總結一下,以後繼續補充 標題如下 the count and say sequence is the sequence of integers beginning as follows 1,11,21,1211,111221,1is read off as one 1 or11...

倒序輸出字串

public static void main string args system.out.println result public static string revertstring string str char chars str.tochararray int len chars.le...