0
点赞
收藏
分享

微信扫一扫

基于范围的for循环


基于范围的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 条评论