SHARE
TWEET

Untitled

a guest Jun 16th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <locale.h>
  4.  
  5. int Red(int *mas, int n) {
  6.     int kol = 0;
  7.     for (int i = 0; i < n; i++) {
  8.         if (mas[i] == 0) kol++;
  9.     }
  10.     return kol;
  11. }
  12.  
  13. int main()
  14. {
  15.     setLocale(LC_ALL, "rus");
  16.     const int N = 100;
  17.     int mas[N];
  18.     for (int i = 0; i < N; i++) {
  19.         mas[i] = rand() % 10;
  20.     }
  21.     printf("Кол-во нулей в массиве: %d", Red(mas, N));
  22.     return 0;
  23. }
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