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, l =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 - 1; 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++)
- for(l = 0; l < z; l++)
- if(temp[z] == temp[l] || temp[z] > n-1) lol++;
- if(lol == 0){
- printf("Jolly\n");
- lol = 0;
- }
- else{
- printf("Not jolly\n");
- lol = 0;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement