for循环遍历

课程:C++ · 编程练习

C++编程练习 - for循环遍历

练习内容

#include <iostream>\nusing namespace std;\n\nint main() {\n string fruits[] = {"苹果", "香蕉", "橙子", "葡萄"};\n\n for (int i = 0; i < 4; i++) {\n cout << "我喜欢吃" << fruits[i] << endl;\n }\n\n