#include <sstream> //ostringstream, ostringstream::str() ostringstream stream; stream << n; //n为要转字符串的整数 string s = stream.str();
个位数转字符:n + '0'
字符转个位数:c - '0'