Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int n;
- int tmp;
- scanf("%d",&n);
- int niza[n];
- for(int i=0;i<n;i++)
- {
- scanf("%d",&niza[i]);
- }
- for(int i=0;i<n;i++)
- {
- for(int j=i+1;j<n;j++)
- {
- if(niza[i]>niza[j])
- {
- tmp = niza[i];
- niza[i] = niza[j];
- niza[j] = tmp;
- }
- }
- }
- for(int i=0;i<n;i++)
- {
- printf("%d ",niza[i]);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment