题解 | 左侧严格小于计数

左侧严格小于计数

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;
}

全部评论

相关推荐

10-21 16:54
门头沟学院 Java
后端转测开第一人:微服务没用 校招都不看微服务的 还有就是后端行情是这样的 找实习纯看运气 秋招更是吃运气和缘分 如果对代码没有极致的追求 可以转测开
应届生简历当中,HR最关...
点赞 评论 收藏
分享
gelmanspar...:奖学金删掉,自我评价删掉,简历压缩一下,写一页
如果再来一次,你还会学机...
点赞 评论 收藏
分享
评论
3
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务