Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
那个大牛帮忙看一下 那个地方不对 谢谢#include <stdio.h> #include <string.h> #include <math.h> int main(void) { int a[3010]; int n,first,second,i,val,flag; while(scanf("%d",&n) != EOF) { flag = 0; memset(a,0,sizeof(a)); scanf("%d",&first); for (i = 1; i < n; i++) { scanf("%d",&second); val = abs(second-first); if ((val == 0 || val >= n) || (a[val] == 1)) { printf("Not jolly\n"); flag = 1; fflush(stdin); break; } a[val] = 1; first = second; } if (flag == 0) { printf("Jolly\n"); } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator