pat 1056
作者:互联网
#include<iostream>
#include<vector>
#include<algorithm>
#include<iterator>
using namespace std;
int main()
{
int sum; cin>>sum;
vector<int> v;
copy(istream_iterator<int>(cin),istream_iterator<int>(),back_inserter(v));
v.shrink_to_fit(),sum=0;
for(int i{};i<v.size();++i){
int idx=0;
while(idx!=v.size())
if(idx!=i) sum+=v[i]*10+v[idx++];
else idx++;
}
cout<<sum;
}
刚学编程没几天
发布了8 篇原创文章 · 获赞 0 · 访问量 1379
私信
关注
标签:pat,1056,iterator,int,sum,cin,istream,include 来源: https://blog.csdn.net/qq_45564275/article/details/104503449