stl入门--reverse函数

#include<iostream>
#include<algorithm>         
using namespace std;
int main()
{
    char a[]="0123456789";
    int len=strlen(a);
    reverse(&a[0],&a[6]);        //a[6]没参加reverse
    for(int i=0;i<10;i++)
        cout<<a[i]<<" ";
    return 0;
}

posted @ 2016-01-27 02:25  胡韬  阅读(207)  评论(0编辑  收藏  举报