You know, i´m getting a wrong answer at submit but can´t findout what´s wrong…
code:
#include <stdio.h>
#include <stdint.h>
int main(void) {
int test;
scanf("%d", &test);
int32_t count[test];
for(int i=0;i<test;i++){
int32_t size;
count[i]=0;
scanf("%d", &size);
int32_t vect[size];
for(int j=0;j<size;j++){
scanf("%d", &vect[j]);
}
for(int j=0;j<size-1;j++){
for(int k=j+1;k<size;k++){
if(vect[k]<vect[j]){
int t = vect[k];
vect[k]=vect[j];
vect[j]=t;
count[i]++;
}
}
}
}
for(int i=0;i<test;i++){
printf("%d\n", count[i]);
}
return 0;
}
I would apreciate any hint on the issue…