Advertisement
jordanov

funkcii ##najmal element

Dec 18th, 2015
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. //Najmal element
  4.  
  5. int mini(int x, int y, int z)
  6. {
  7.     if(x>y)
  8.     {
  9.         x=y;
  10.     }
  11.     if(x>z)
  12.     {
  13.         x=z;
  14.     }
  15.     return x;
  16. }
  17.  
  18. int main()
  19. {
  20.     int n,i,x,y,z;
  21.  
  22.     scanf("%d ", &n);
  23.     for(i=0;i<n;i++)
  24.     {
  25.         scanf("%d%d%d", &x, &y, &z);
  26.         printf("%d\n", mini(x,y,z));
  27.     }
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement