1 条题解

  • 0
    @ 2026-4-2 19:10:30

    #include<bits/stdc++.h> using namespace std; int a[20]; bool baobo(int x,int y){ if (x % 2 != 0 && y % 2 != 0){ if (x > y){ return 1; }else { return 0; } }else if(x % 2 == 0 && y % 2 == 0){ if (x > y){ return 0; }else { return 1; } }else { if (x % 2 != 0 && y % 2 == 0){ return 1; }else { return 0; } } } int main(){ for (int i = 0;i < 10;i++){ cin >> a[i]; } sort(a , a + 10,baobo); for (int i = 0;i < 10;i++){ cout << a[i] << " "; } return 0; }

    信息

    ID
    206
    时间
    1000ms
    内存
    128MiB
    难度
    3
    标签
    (无)
    递交数
    33
    已通过
    19
    上传者