题解 | 左侧严格小于计数
左侧严格小于计数
https://www.nowcoder.com/practice/c5922c6cdd1445749bd42f586c422435
#include <stdio.h>
int main() {
int n;
scanf("%d",&n);
int arr[n];
int m;
for(int i=0;i<n;i++){
scanf("%d",&m);
arr[i]=m;
}
for(int j=0;j<n;j++){
int count =0;
for(int m=j-1;m>=0;m--){
if(arr[j]>arr[m]){
count+=1;
}
}
printf("%d",count);
printf(" ");
}
return 0;
}