为什么4,5,6,8会wa?
查看原帖
为什么4,5,6,8会wa?
976110
nyjnyjnyj楼主2023/4/1 09:37
这是代码:
  #include<bits/stdc++.h>
  using namespace std;
  int main(){
      int t,a[1010],x=0;
      cin>>t;
      for(int i=1;i<=t;i++)cin>>a[i];
      sort(a+1,a+t+1);
      for(inti=1;i<t;i++)
      	if(a[i+1]a[i]!=1)
        x=1;
      if(x==0)cout<<"Jolly";
      else cout<<"Not jolly";
      return 0;
  }
2023/4/1 09:37
加载中...