#include <bits/stdc++.h>
using namespace std;
long long a[50],n,i,t;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
for (i=1; i<=n; i++) cout<<a[i]<<" ";
cout<<endl;
for (i=n; i>=1; i--) cout<<a[i]<<" ";
cout<<endl;
t=0;
for (i=1; i<=n; i++) if (a[i]%2!=0) t=t+a[i];
cout<<t;
return 0;
}
Đúng 0
Bình luận (0)