题解 | 左侧严格小于计数

左侧严格小于计数

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

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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