#include<iostream>
using namespace std;
int main(){
int array[]={1,2,5,7,6,8,9};
//输出全部数组数据--way 1
for(int i=0;i<7;i++){
cout<<array[i]<<" ";
}
//way 2
for(int x: array){
cout<<x<<" ";
}
return 0;
}
#include<iostream>
using namespace std;
int main(){
int array[]={1,2,5,7,6,8,9};
//输出全部数组数据--way 1
for(int i=0;i<7;i++){
cout<<array[i]<<" ";
}
//way 2
for(int x: array){
cout<<x<<" ";
}
return 0;
}