基于范围的for循环这个功能需要在g++ 4.6版本之上才能使用
#include<iostream>
#include<stdint.h>
using namespace std;
int main(){
double prices[] = {4.99, 10.02, 3,45, 6.002};
for (double price : prices){
cout<<price<<endl;
}
}
基于范围的for循环这个功能需要在g++ 4.6版本之上才能使用
#include<iostream>
#include<stdint.h>
using namespace std;
int main(){
double prices[] = {4.99, 10.02, 3,45, 6.002};
for (double price : prices){
cout<<price<<endl;
}
}