#include <stdio.h>
int array[1000], index;
int main()
{
int n, i, tmp, j, count;
while (scanf("%d", &n) == 1)
{
index = 0, count = 0;
while (n --)
scanf("%d", &array[index ++]);
for (i = 0; i < index; i ++)
for (j = 0; j < i; j ++ )
if (array[j] > array[i])
count ++;
printf("Minimum exchange operations : %d\n", count);
}
return 0;
}
回目錄
回首頁
沒有留言 :
張貼留言