Вставить после всех столбцов, в которых есть отрицательные элементы, первый столбец. #include #include #include #include #include void Transformation(int *pA, int Rows, int *Columns) { } int main(void) { setlocale(LC_ALL, "rus"); int Rows = 0, Columns = 0, *pA, k, t; while (Rows<5 || Rows>10) { printf("Количество строк(от 5 до 10): "); scanf_s("%d", &Rows); } while (Columns<5 || Columns>10) { printf("Количество столбцов(от 5 до 10): "); scanf_s("%d", &Columns); } pA = (int*) calloc(Columns * Rows * 2, sizeof(int)); if (!pA) printf("\nОшибка: Недостаточно памяти."); else { printf("\nВведите промежуток [-k;t]: "); scanf_s("%d%d", &k, &t); srand((unsigned) time(NULL)); printf("\nЭлементы массива:\n\n"); for (int i = 0; i < Rows; i++) { for (int j = 0; j < Columns; j++) { *(pA + i * Rows + j) = rand() % (t - k + 1) + k; printf("%4d", *(pA + i * Rows + j)); } printf("\n"); } Transformation(pA, Rows, &Columns); printf("\nЭлементы нового массива:\n"); for (int i = 0; i < Rows; i++) { for (int j = 0; j < Columns; j++) { printf("%4d", *(pA + i * Rows + j)); } printf("\n"); } free(pA); } printf("\n\n...Нажмите любую клавишу для выхода"); _getch(); return 0; }