语法格式:for(declaration : expression){statement} string str("some string");// 每行输出str中的一个字符for(auto c : str) // 对于str中的每个字符{ cout << c << endl;}