为啥有三个wa,怎么不对,大佬们求解
查看原帖
为啥有三个wa,怎么不对,大佬们求解
1523606
Y1269楼主2025/1/19 11:13

#include<stdio.h> int main() { int a[10],b[10]; int i,n,i2; scanf("%d",&n);

for(i=0;i<n;i++){
  scanf("%d",&a[i]);
  b[i]=0;
  
  for(i2=0;i2<n;i2++){
  	if(a[i2]<a[i]){
    b[i]++;
    }
    }

 }
   for(i=0;i<n;i++){
  	printf("%d ",b[i]);
     
#include<stdio.h>

int main()
{

  int a[10],b[10];
  int i,n,i2;
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
      scanf("%d",&a[i]);
      b[i]=0;
      
      for(i2=0;i2<n;i2++){
      	if(a[i2]<a[i]){
        b[i]++;
        }
	    }

  }
  for(i=0;i<n;i++){
      	printf("%d ",b[i]);
	}
      
 

return 0;

}

}

 return 0;

  }
2025/1/19 11:13
加载中...