60分(泪
查看原帖
60分(泪
427617
蒟蒻珂学家楼主2021/8/12 11:57
#include <iostream>
#include <cmath>
using namespace std;
int main(){
    int n, a[1000], b[1000];
    bool yes = true;
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> a[i];//1 4 2 3
    }for(int i = 0; i < n - 1; i++){
        b[i] = abs(a[i + 1] - a[i]);
    }for(int i =0; i < n - 1; i++){
        if(b[i] < b[i + 1]){
            yes = false;
        }
    }if(yes == true){
        cout << "Jolly";
    }else{
        cout << "Not jolly";
    }
    return 0;
}
2021/8/12 11:57
加载中...