Threed90

Масив/Array

Dec 20th, 2019
36
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void Print(int arr[], int len)
  5. {
  6.    
  7.     for (int i = 0; i < len; i++)
  8.     {
  9.         printf_s("%d\n", arr[i]);
  10.     }
  11. }
  12.  
  13. int main()
  14. {
  15.     int arr[3];
  16.     int len = sizeof(arr) / sizeof(*arr);
  17.  
  18.     for (int i = 0; i < len; i++)
  19.     {
  20.         scanf_s("%d", &arr[i]);
  21.     }
  22.  
  23.     Print(arr, len);
  24.    
  25.     system("pause");
  26.     return 0;
  27. }
RAW Paste Data