Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(){
- int n = 0, z = 0, count[3000], temp[3000], lol = 0;
- while(scanf("%d", &n) != EOF){
- for(z = 0; z < n; z++)
- scanf("%d", &count[z]);
- for(z = 0; z < n; z++)
- temp[z] = count[z] - count[z+1];
- for(z = 0; z < n - 1; z++){
- if(temp[z] < 0)
- temp[z] *= -1;
- }
- for(z = 0; z < n - 1; z++)
- if(temp[z] > n - 1)
- lol++;
- if(lol == 0)
- printf("Jolly\n");
- else if(lol > 0)
- printf("Not jolly");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement