Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Dec 7th, 2018 66 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <limits.h>
  4.  
  5. int MinCount (int *a, int n){
  6.     int i,count=1, min=INT_MAX;
  7.     for (i=0;i<n;i++){
  8.         if (a[i]<min){ min=a[i]; count=1; }
  9.         else if (a[i]==min) count++;
  10.     }
  11.     return count;
  12. }
  13.  
  14. int RandFill (int *a, int n){
  15.     int i;
  16.     for (i=0;i<n;i++)
  17.         a[i]=rand () % 10 + 1;
  18. }
  19.  
  20. int main (){
  21.     int n,i;
  22.     printf ("n="); scanf("%d",&n);
  23.     int a[n];
  24.     RandFill (a,n);
  25.     for (i=0;i<n;i++)
  26.         printf ("%d", a[i]);
  27.     printf ("\n");
  28.     printf ("Kolichestvo min elemetov ="); printf(" %d",MinCount(a,n));
  29.     return 0;
  30. }
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