Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <cstdlib>
- #include <cmath>
- #include <ctime>
- /*
- ege27
- Задание 76
- */
- using namespace std;
- int main() {
- setlocale(LC_ALL, "Russian");
- srand((unsigned)time(NULL));
- int N;
- printf("Введите количество цифр: "); cin >> N;
- int *iArray = new int[N];
- /*
- Заполняем массив рандомными значениями.
- */
- for (int i = 0; i < N; i++)
- {
- iArray[i] = rand() % 10000 + 1;
- int ceil_num = static_cast< int >(ceil(log10(iArray[i])));
- printf("[%d] - [%d]\n", iArray[i], ceil_num);
- iArray[i] = ceil_num;
- }
- /*for (int i = 0; i < N; i++)
- {
- }*/
- delete[] iArray;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement