Advertisement
CristinaGeorgiu

14-lucrare vectori

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