基于范围的for循环

阅读 25

2023-10-28


基于范围的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;
    }
}


相关推荐

精彩评论(0)

0 0 举报