@[q283173921](/space/show?uid=131019) 希望更丰富的展现?使用Markdown
by 只用函数 @ 2018-10-20 23:17:28
[markdowm](https://www.luogu.org/wiki/show?name=帮助:markdown)
by 只用函数 @ 2018-10-20 23:18:23
~~~cpp
#include<iostream>
#include<algorithm>
#include<cstring>
#include<string>
#include<cstdio>
#include<cmath>
using namespace std;
long long n,ans;
long long a[101];
int main()
{
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>a[i];
ans=0;
for(int j=1;j<i;j++)if(a[i]>a[j])ans++;
cout<<ans<<' ';
}
return 0;
}
~~~
by 只用函数 @ 2018-10-20 23:18:53
@[q283173921](/space/show?uid=131019)
改为这样:
```
#include<stdio.h>
int n,x[100000],a[100000],i,j,l;
int main()
{
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d",&x[i]);
}
for(j=1;j<=n;j++)
{
a[j]=0;
for(l=1;l<j;l++)
{
if(x[l]<x[j]) a[j]=a[j]+1;
else a[j]=a[j];
}
}
for(i=1;i<=n;i++)
{
printf("%d ",a[i]);
}
return 0;
}
```
就AC了
by 爱迪生 @ 2018-10-20 23:32:37