eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків
Задачі

Sum of Odd Sequence

опубліковано 17.03.24, 12:23:02

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;
    }
}

}