可以这样输出 cout<<"姓名:"<<setw(10)<<"sbs"<<" "<<"年龄:"<<setw(5)<<"20"<<endl;cout<<"姓名:"<<setw(10)<<"bss"<<" "<<"年龄:"<<setw(5)<<"20"<<endl;要记住要有头文件<iomanip> 更详细可以看http://c.biancheng.net/cpp/biancheng/view/116.html ...