askarulytarlan

Задача №63. A[0], A[2], A[4], ...

Oct 24th, 2016
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <cmath>
  4. #include <math.h>
  5.  
  6.  
  7. using namespace std;
  8.  
  9. int massive[100];
  10. int d;
  11. int main(int argc, const char * argv[]) {
  12. cin >> d;
  13. for(int i = 1; i <= d; i++){
  14. cin >> massive[i];
  15. }
  16. for(int i = 1; i <= d; i++){
  17. if(i % 2 == 1){
  18. cout << massive[i] << " ";
  19. }
  20. }
  21. }
Add Comment
Please, Sign In to add comment