CE,跟着编译器改了一下,没啥用
错误代码:
#include<bits/stdc++.h>
using namespace std;
int n,i,a[1e9+6];
int main()
{
cin>>n;
for(i=1;i<=n;i++) cin>>a[i];
sort(a,a+n);
for(i=1;i<=n;i++) cout<<a[i];
return 0;
}
错误信息:
/tmp/compiler_ruokslvy/src:3:14: 错误:conversion from ‘double’ to ‘long unsigned int’ in a converted constant expression
3 | int n,i,a[1e9+6];
| ~~~^~
/tmp/compiler_ruokslvy/src:3:14: 错误:could not convert ‘(1.0e+9 + (double)6)’ from ‘double’ to ‘long unsigned int’
3 | int n,i,a[1e9+6];
| ~~~^~
| |
| double
/tmp/compiler_ruokslvy/src:3:14: 错误:数组‘a’的大小具有非整数类型‘double’