c语言怎么写中文

在 c 语言中输出中文需要以下步骤:将源代码文件编码为 utf-8。使用 setlocale() 函数设置语言环境:setlocale(lc_all, "");使用 printf() 函数输出中文,需以 utf-8 编码字符串作为参数。