Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- const int SIZE = 10;
- void main()
- {
- cout << "Hello, please enter " << SIZE << " numbers : ";
- int arr[SIZE] = { 0 }, i = 0;
- for (i = 0; i < SIZE; i++)
- cin >> arr[i];
- for (int j = 0; j < SIZE; j++)
- {
- if (j % 2 == 0 && j % 3 == 0)
- cout << arr[j];
- else if (j % 2 == 0)
- {
- arr[j] += 1;
- cout << arr[j] << endl;
- }
- else if (j % 3 == 0)
- {
- arr[j] -= 1;
- cout << arr[j] << endl;
- }
- else
- cout << arr[j];
- }
- system("pause");
- system("CLS");
- }
Advertisement
Add Comment
Please, Sign In to add comment