rev='made'/> name='keywords'/> name='author'/> ANURANAN: UVa Problem Solution 10327 - Flip Sort

Welcome Note

Hi,
I'm Anisuzzaman Babla . I am a full stack Android Application Developer. I am working with Android for more than two years. I have completed my graduation from IIT, Jahangirnagar University. I have developed a series of commercially successful apps on Android. Moreover, 10+ of my Apps are live at Google play store. .
Thank You

UVa Problem Solution 10327 - Flip Sort

    #include<stdio.h>
    int main()
    {
    int n,temp,num[1001],flip,i,j;
    while(scanf("%d",&n)==1)
    {
    for(i=1;i<=n;i++)
    {
    scanf("%d",&num[i]);
    }
    flip=0;
    for(i=1;i<=n;i++)
    {
    for(j=i+1;j<=n;j++)
    {
    if(num[i]>num[j])
    flip++;
    }
    }
    printf("Minimum exchange operations : %d\n",flip);
    }
    return 0;
    }

No comments:

Post a Comment