输入string,输出string或者char[] string str; printf("%c",str[i]);//输出字符串 printf("%s\n",str.c_str());//字符串变成字符数组