SHARE
TWEET

Untitled

a guest Mar 19th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string>
  3.  
  4.  
  5. int Arr(int A[],int n)
  6. {
  7.     int i;
  8.     for (i = 0; i < n; i++)
  9.         A[i] = rand() % 11 - 5;
  10.     for (i = 0; i < n; i++)
  11.         printf("%d \t", A[i]);
  12.     printf("\n");
  13.     return 0;
  14.  
  15. }
  16.  
  17. int Min(int A[], int n)
  18. {
  19.     int i;
  20.     int m;
  21.     m = A[0];
  22.     for (i = 0; i < n; i++)
  23.         if(A[i] < m)
  24.             m = A[i];
  25.     return 0;
  26. }
  27.  
  28. int Zer(int A[], int n)
  29. {
  30.     int i;
  31.     int k;
  32.     for (i = 0; i < n; i++)
  33.         if(A[i] == 0)
  34.             k++;
  35.     printf("k = %d \t", k);
  36. }
  37.            
  38. int main()
  39. {
  40.     setlocale(LC_ALL, "Russian");
  41.     srand(time(NULL));
  42.  
  43.     const int N = 10, M = 15;
  44.     int X[N], Y[M];
  45.  
  46.     X[N] = Arr(X, N);
  47.     Y[M] = Arr(Y, M);
  48.    
  49.     if (Min(X, N) >= Min(Y, M))
  50.         Zer(X, N);
  51.     else
  52.         Zer(Y, M);
  53.            
  54.     system("pause");
  55.     return (0);
  56. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top