#include<iostream>
using namespace std;
int main()
{
int a[10];
for (int i = 0; i <= 9; i++)
a[i] = i;
for (auto i : a)//遍历数组所有元素 最好的办法也是使用范围for语句
cout << i << " ";
cout << endl;
return 0;
}
3.31
最新推荐文章于 2024-03-31 08:13:30 发布
#include<iostream>
using namespace std;
int main()
{
int a[10];
for (int i = 0; i <= 9; i++)
a[i] = i;
for (auto i : a)//遍历数组所有元素 最好的办法也是使用范围for语句
cout << i << " ";
cout << endl;
return 0;
}