Josif_tepe

Untitled

Dec 20th, 2025
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream> //
  2. using namespace std;
  3. int main(){
  4.     int n;
  5.    cin>>n;
  6.    int a[n];
  7.    for(int i=0; i<n; i++){
  8.        cin>>a[i];
  9.      
  10.    }
  11.    int zbir=0;
  12.    for(int i=0; i<n; i++){
  13.        if(a[i]%7==0){
  14.            cout<<a[i]<<" ";
  15.        }
  16.        if(i%2==0){
  17.            zbir+=a[i];
  18.        }
  19.    }
  20.    cout<<zbir<<" ";
  21.    return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment