我也把刚刚学C++的几个例子拿出来显摆哈
#include<iostream>#include<algorithm>
#include<functional>
using namespace std;
void main(){
int list[]={1,4,34,5},b[4];
copy(a,a+4,ostream_iterator<int >(cout," "));
cout<<endl;
sort(a,a+4);
copy(a,a+4,ostream_iterator<int >(cout, " "));
cout<<endl;
copy(a,a+4,b);
copy(b,b+4,ostream_iterator<int >(cout," "));
cout<<endl;
int *c=find(a,a+4,34);
if(c=a+4) cout<<"没有这个数"<<endl;
else cout<<*c<<endl;
}