50分,本应成立的输出不成立
查看原帖
50分,本应成立的输出不成立
678057
_TeaClaudz_楼主2022/10/6 15:20
#include<bits/stdc++.h>
using namespace std;

int a[1000];

int main()
{
    int n;
    bool failed = 0;
    cin >> n;
    for(int i = 0; i < n; ++i)
    {
        cin >> a[i];
    }
    for(int i = 0; i < n-1; ++i)
    {
        int x = abs(a[i+1] - a[i]);
        for(int j = 0; j < n; ++i)
        {
            if(x != a[j])
            {
                failed = 1;
                goto end;
            }
        }
    }
    end:if(failed)
    {
        cout << "Not jolly";
    }
    else
    {
        cout << "Jolly";
    }
    return 0;
}
2022/10/6 15:20
加载中...