Advertisement
JCLC

Untitled

May 18th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(){
  5.     int n = 0, z = 0, count[3000], temp[3000], lol = 0;
  6.  
  7.     while(scanf("%d", &n) != EOF){
  8.  
  9.     for(z = 0; z < n; z++)
  10.         scanf("%d", &count[z]);
  11.  
  12.     for(z = 0; z < n; z++)
  13.          temp[z] = count[z] - count[z+1];
  14.  
  15.     for(z = 0; z < n - 1; z++){
  16.         if(temp[z] < 0)
  17.           temp[z] *= -1;
  18.     }
  19.  
  20.     for(z = 0; z < n - 1; z++)
  21.         if(temp[z] > n - 1)
  22.             lol++;
  23.  
  24.     if(lol == 0)
  25.        printf("Jolly\n");
  26.     else if(lol > 0)
  27.        printf("Not jolly");
  28.     }
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement