Advertisement
Mazamin

01_10_1.2

Oct 2nd, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. /*
  2.  * File:   main.c
  3.  * Author: Gerardo Cicalese
  4.  *
  5.  * Created on 16 settembre 2019, 15.48
  6.  */
  7.  
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10.  
  11. int minvex(int * vex, int n){
  12.     if(n<2)
  13.         return *vex;
  14.     else{
  15.         int a=minvex(vex+1, n-1);
  16.         if(a<*vex)
  17.             return a;
  18.         else
  19.             return *vex;
  20.     }
  21. }
  22.  
  23. int main(void){
  24.     int min, vex[]={63, 15, 42, 63, 92, 34, 77, 23, 78, 37, 26, 7, 79, 85, 82, 19, 89, 10, 64};
  25.     size_t len=sizeof(vex)/sizeof(vex[0]);
  26.     printf("Min is %d\n", minvex(vex, len));
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement