djelad1

Untitled

Nov 14th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. const int SIZE = 10;
  4. void main()
  5. {
  6. cout << "Hello, please enter " << SIZE << " numbers : ";
  7. int arr[SIZE] = { 0 }, i = 0;
  8. for (i = 0; i < SIZE; i++)
  9. cin >> arr[i];
  10.  
  11. for (int j = 0; j < SIZE; j++)
  12. {
  13. if (j % 2 == 0 && j % 3 == 0)
  14. cout << arr[j];
  15. else if (j % 2 == 0)
  16. {
  17. arr[j] += 1;
  18. cout << arr[j] << endl;
  19. }
  20. else if (j % 3 == 0)
  21. {
  22. arr[j] -= 1;
  23. cout << arr[j] << endl;
  24. }
  25. else
  26. cout << arr[j];
  27. }
  28.  
  29. system("pause");
  30. system("CLS");
  31. }
Advertisement
Add Comment
Please, Sign In to add comment