迭代器1

#include<iterator>
#include<iostream>
#include<algorithm>
using namespace std;
double square(double x){
return x*x;
}
int main()
{
transform(istream_iterator<double>(cin),istream_iterator<double>(),ostream_iterator<double>(cout,"\t"),square);
cout<<endl;
return 0;
}

posted @ 2023-04-25 19:00  不会JAVA的小袁  阅读(8)  评论(0编辑  收藏  举报