Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <malloc.h>
- #include <stdlib.h>
- int main()
- {
- int *a; // указатель на массив
- int i, n;
- printf("Введите размер массива: ");
- scanf("%d", &n);
- // Выделение памяти
- a = (int*)malloc(n * sizeof(int));
- // Ввод элементов массива
- for (i = 0; i<n; i++)
- {
- printf("a[%d] = ", i);
- scanf("%d", &a[i]);
- }
- // Вывод элементов массива
- for (i = 0; i<n; i++)
- printf("%d ", a[i]);
- free(a);
- getchar();
- return 0;
- }
- int length = 1;
- scanf("%d", &length);
- double array[length];
- ...
Add Comment
Please, Sign In to add comment