c#WINDOWS椤圭洰寮€鍙戯細缂栫▼闂 - 宸茶В鍐?- 鎼滄悳闂棶
缂栧啓涓€涓簲鐢ㄧ▼搴忥紝鑳芥帴鏀剁敤鎴疯緭鍏ョ殑鏁版嵁锛屽苟鑳藉皢璇ユ暟杩涜闃挎媺浼暟瀛楀垎绂伙紝杈撳嚭杩欏垎绂诲悗鐨勮繖缁勬暟瀛楋紝鏁板瓧闂寸敤閫楀彿闅斿紑锛屽锛氳緭鍏?5678锛屽垯蹇呴』杈撳嚭4锛?锛?锛?锛?~~~~~~
浼氱殑鏉~~~~~
缂栧啓涓€涓簲鐢ㄧ▼搴忥紝鑳芥帴鏀剁敤鎴疯緭鍏ョ殑鏁版嵁锛屽苟鑳藉皢璇ユ暟杩涜闃挎媺浼暟瀛楀垎绂伙紝杈撳嚭杩欏垎绂诲悗鐨勮繖缁勬暟瀛楋紝鏁板瓧闂寸敤閫楀彿闅斿紑锛屽锛氳緭鍏?5678锛屽垯蹇呴』杈撳嚭4锛?锛?锛?锛?~~~~~~
浼氱殑鏉~~~~~
答案:string str = Console.ReadLine();
string k="";
for (int i = 0; i < str.Length; i++)
{
if (i == 0)
{
k = str.Substring(i, 1);
}
else
{
k = k + "," + str.Substring(i, 1);
}
}
Console.WriteLine(k);鏁堟灉
杩欎釜鎮ㄦ弧鎰忓悧銆?