65,178
社区成员




void rotate(vector<int>& nums, int k) {
vector<int>tmp{100, 200, 300, 400};
for (auto i : tmp) //auto是让i为可变的类型
{ //这种叫做基于范围的for循环,可遍历然和可迭代对象,比如动态数组
// 如队列就不支持基于范围的循环
cout << i << " ";
}cout << "\n";
//如果如下语句
//auto tt = 0.0; tt就是double类型
//auto tt = 1; tt就是int类型
}