SHARE
TWEET

Untitled

a guest Dec 4th, 2010 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<math.h>
  4. void nhapso(int a,int b,int c)
  5. {
  6.         printf("\n Moi ban nhap vao so thu nhat :");
  7.         scanf("%d",&a);
  8.         printf("\n Moi ban nhap vao so thu hai  :");
  9.         scanf("%d",&b);
  10.         printf("\n Moi ban nhap vao so thu ba :");
  11.         scanf("%d",&c);
  12. }
  13. int gtln(int x,int y,int z)
  14. {
  15. int max;
  16. max=x;
  17. if(max<y) max=y;
  18. if(max<z) max=z;
  19. return max;
  20. }
  21. int gtnn(int x,int y,int z)
  22. {
  23.         int min;
  24.         min=x;
  25.         if(y<min) min=y;
  26.         if(z<min) min=z;
  27.         return min;
  28. }
  29. void minmax(int x,int y,int z)
  30. {
  31.         printf("\n Trong 3 so %d , %d va %d :", x , y , z);
  32.         printf("\n So lon nhat : %d " , gtln(x,y,z));
  33.         printf("\n So nho nhat : %d " , gtnn(x,y,z));
  34. }
  35. void main()
  36. {
  37.         int n,a,b,c,x,y,z;
  38.         nhapso(a,b,c);
  39.         x=a;y=b;z=c
  40.         minmax(x,y,z);
  41.         getch();
  42. }
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