Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- using namespace std;
- int main()
- {
- SetConsoleOutputCP(1251);
- auto const n{ 7 };
- int x[n] = { -6, 12, 3, -2, 16, 5, 6 }, i{};
- cout << "Вихідний масив: " << endl;
- for (i; i <= n - 1; i++) {
- cout << x[i] << " ";
- }
- cout << endl;
- cout << "Перетворений масив:" << endl;
- for (i = 0; i <= n - 1; i++) {
- if (x[i] % 2 != 0) {
- x[i] = 0;
- }
- cout << x[i] << " ";
- }
- cout << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement