-
-
Save rkhang7/f0384d0d20978ad08b1e99bb24d121dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sap xep 4 so theo thu tu giam dan | |
#include <stdio.h> | |
#include <conio.h> | |
int main() | |
{ | |
int a[4]; | |
printf("nhap 4 so:"); | |
for(int i=0;i<4;i++) | |
scanf("%d",&a[i]); | |
for(int i=0;i<4;i++) | |
{ | |
for(int j=i+1;j<4;j++) | |
if(a[i]<a[j]) | |
{ | |
int temp=a[i]; | |
a[i]=a[j]; | |
a[j]=temp; | |
} | |
} | |
printf("4 so sau khi sap xep la "); | |
for(int i=0;i<4;i++) | |
printf("%d ",a[i]); | |
getch(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment