for(auto &a:b) 和 string t(n, '.')

for(auto &a:b) 等同于for(int i=0; i<sizeof(b); i++)

其中a是遍历b的每一个元素。

 

string t(n, '.');

生成字符串t,每个元素都为'.'。

posted @ 2019-10-06 20:43  牧牛子  阅读(711)  评论(0编辑  收藏  举报