标签:icpc print for input min mes mic sea ret
4 1 4 2 3 5 1 4 2 -1 6
Happy luguan Not happy luguan
#include<bits/stdc++.h> using namespace std; int n, a[10000+8]; int main() { while(~scanf("%d", &n) && n != 0) { bool flag = 1; for(int i = 0; i<n; i++) scanf("%d", &a[i]); for(int i = 0; i<n-1; i++) { int number = abs(a[i]-a[i+1]); if(number>0 && number<n)continue; else { flag = 0; break; } } if(flag)printf("Happy luguan\n"); else printf("Not happy luguan\n"); } return 0; }
标签:icpc print for input min mes mic sea ret
原文地址:https://www.cnblogs.com/RootVount/p/10969909.html