Advertisement
RiQ363

Untitled

Jan 18th, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. //---------------------------------------------------------------------------
  2.  
  3. #pragma hdrstop
  4.  
  5. //---------------------------------------------------------------------------
  6.  
  7. #pragma argsused
  8.  
  9. #include <stdio.h>
  10. #include <math.h>
  11. #include <conio.h>
  12. #define N 10
  13.  
  14. int Count (int *a, int n)
  15. {
  16.  return (n<1)?0:(a[n-1]>1)+Count(a,n-1);
  17. }
  18.  
  19. int main()
  20. {
  21.  int a[N],i;
  22.  for(i=0;i<N;i++)
  23.  {
  24.     a[i]=rand()%10;
  25.     printf("%d ",a[i]);
  26.  }
  27.    printf("\n");
  28.    printf("k=%d\n",Count(&a,N));
  29.   getch();
  30.  return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement