为什么拿不到第一个点?
查看原帖
为什么拿不到第一个点?
808736
wangziye20110331楼主2024/10/19 22:50

请不要把AC代码发出来,我正在练习骗分

第一个点为什么拿不到分?第一个点与第五个点错误

#include <bits/stdc++.h>
using namespace std;

long long n,a,b,c;

int main()
{
    cin >> n;
    for(int i = 1;i <= n;i++)
    {
        if(n == 3) cin >> a >> b >> c;
        else if(n == 2) cin >> a >> b;
        else if(n == 1) cin >> a;
    }
    if(n == 1)
    {
        cout << "0" << endl;
        return 0;
    }
    else if(n == 2)
    {
        cout << "1" << endl;
        return 0;
    }
    else if(n == 3)
    {
        if(a > b and b > c) cout << "2" << endl;
        else if(a > b and c == b) cout << "1" << endl;
        else if(a > c and c > b) cout << "1" << endl;
        else if(a > b and a > c)
        {
            if(c < b) cout << "2" << endl;
            else if(c == b) cout << "1" << endl;
        }
        else if(a == b and b > c) cout << "2" << endl;
        else if(a == c and c == b) cout << "2" << endl;
        else if(a == b and a > c) cout << "2" << endl;
        else if(b > a and a > c) cout << "1" << endl;
        else if(b > c and c > a) cout << "1" << endl;
        else if(c > a and a > b) cout << "1" << endl;
        else if(a > b and b > c) cout << "0" << endl;
    }
    return 0;
}
2024/10/19 22:50
加载中...