2 条题解

  • 0
    @ 2025-10-27 22:50:04
    #include<stdio.h>
    #include<string.h>
    
    int main(){
    	
    	int n;
    	scanf("%d",&n);
    	
    	int tot[100];
    	for(int i=0;i<n;i++){
    		scanf("%d",&tot[i]);
    	}
    	int count=0;
    	for(int i=0;i<n;i++)
    	{
    		for(int j=i;j<n;j++)
    		{
    			if(tot[i]>tot[j])
    			{
    				count++;
    			}	
    		}	
    	}
    	printf("%d",count);
    	
    	return 0;
    }
    

    信息

    ID
    718
    时间
    1000ms
    内存
    256MiB
    难度
    1
    标签
    (无)
    递交数
    110
    已通过
    77
    上传者