听说灌水区大佬多,所以我带着我那全部 re 的代码来求助……大佬们请问我错哪里了?
我的代码:
#include<bits/stdc++.h>
using namespace std;
int n;
int a[101] = {0};
int main() {
scanf("%d", &n);
for (int i = 1; i <= n; i++)
scanf("%d", a[i]);
for (int i = 1; i <= n; i++) {
int Sum = 0;
for (int j = 0; j <= i; j++)
if (a[j] < a[i])
Sum++;
printf("%d ", Sum);
Sum = 0;
}
return 0;
}
在本地测试时,结果如下:
6
4 3 0 5 1 2
---------------------
Process exited after 17.1 seconds with return value 3221225477
感谢!