- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- int z[10] = {20, 0, 30, 0, 40, 0, 50, 0, 60, 0};
- z[1] = z[0] - 5;
- z[3] = z[2] - 5;
- z[5] = z[4] - 5;
- z[7] = z[6] - 5;
- z[9] = z[8] - 5;
- cout << z[0] << " " << z[1] << " " << z[2] << " " << z[3] << " " << z[4] << " ";
- cout << z[5] << " " << z[6] << " " << z[7] << " " << z[8] << " " << z[9] << endl;
- cout << endl;
- system ("pause");
- return 0;
- }
複製代碼 |