eolymp
bolt
Try our new interface for solving problems
Problems

Sum of Odd Sequence

published at 3/17/24, 12:23:02 pm

include <bits/stdc++.h>

define ll long long

define ld long double

using namespace std; int main(){

ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll n, ans = 0, k;
cin>>n;
for(int i = 0; i<n; i++){
    cin>>k;
    if(k%2!=0){
        ans+=k;
        cout<<ans<<endl;
    }
}

}