for (auto& a : A) cin >> a; code example Example: range based for loop c++ for (<variable_declaration> : expression){ //statements }