Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctime>
- using namespace std;
- int main() {
- int N;
- setlocale(LC_ALL, "Russian");
- srand(time(NULL));
- int mas[100];
- cout << "Введите размер массива: "; cin >> N;
- for (int i = 0; i < N; i++)
- mas[i] = 1 + rand() % 5;
- for (int i = 0; i < N; i++)
- cout << mas[i] << " ";
- int K = N;
- while (K > 0) mas[K--] = mas[K - 1];
- mas[0] = 0;
- cout << endl;
- for (int i = 0; i < N; i++)
- cout << mas[i] << " ";
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment