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