在vs可以运行的 但是提交会报错 问哪里有问题?
#include<algorithm>
using namespace std;
bool camparea(int a,int b)
{ return a > b;}
bool campareb(int a, int b)
{ return a < b;}
bool rulea(int a)
{ return a % 2!=0;}
bool ruleb(int b)
{ return b % 2 == 0;}
int main()
{ int s=0,i,ary[10];
for (i = 0; i < 10; i++)
{ cin >> ary[i];
if (ary[i] % 2 == 0)
s++; }
int* a = new int[10 - s];
int* b = new int[s];
copy_if(ary, ary+10, a, rulea);
copy_if(ary, ary+10, b, ruleb);
sort(a, a + 10-s, camparea);
sort(b, b + s, campareb);
for (i = 0; i < 10-s; i++)
cout << a[i]<<" ";
for (i = 0; i < s; i++)
cout << b[i] << " ";}