Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Tim max, min, va sap xep 3 so a,b,c//
- #include <stdio.h>
- #define MAX(x,y) (x>y)?x:y
- #define MIN(x,y) (x<y)?x:y
- int main()
- {
- int a,b,c,sg;
- printf(Nhap a,b,c: \n);scanf("%d%d%d",&a,&b,&c); //Nhap a,b,c.
- printf("So lon nhat la: %d",MAX(MAX(a,b),c)); //MAX.
- printf("So nho nhat la: %d",MIN(MIN(a,b),c)); //MIN.
- sg=a+b+c-(MAX(MAX(a,b),c)+MIN(MIN(a,b),c)); //Tinh so giua trong day sap xep.
- printf("Sap xep tang dan: %d, %d, %d",MIN(MIN(a,b),c),sg,MAX(MAX(a,b),c));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement