전시장 하는 중...

#include<stdio.h>

int ar[300000]={0};
int mo[300000]={0};
int main()
{
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    int n,m;
    int temp=0;
    int i,j,k;
    scanf("%d %d",&n,&m);
    for(i=0;i<n;i++)
    {
        scanf("%d %d",&ar[i],&mo[i]);
    }
    for(i=0;i<n-1;i++)
    {
        for(j=n-1;j>i;j--)
        {
            if(ar[j]<ar[j-1]);
            {
                temp=ar[j];
                ar[j]=ar[j-1];
                ar[j-1]=temp;

                temp=mo[j];
                mo[j]=mo[j-1];
                mo[j-1]=temp;
            }
        }
        for(i=0;i<n;i++)
        {
            printf("%d %d\n ",ar[i]);
        }
    }
    return 0;
}

일단 정렬 결과를 보려고 printf를 썼는데

input은

6  4

15 80

8 230

10 100

17 200

20 75

26 80

output은

6 4

8 230

10 100

15 80

17 200

20 75

26 80

이렇게 나와야 되는데

26 80
15 80
8 230
10 100
17 200
20 75
이렇게 나와요...

뭐가 잘못됬나요...