Advertisement
MinhNGUYEN2k4

Untitled

Nov 23rd, 2021
711
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #define _CRT_NONSTDC_NO_DEPRECATE
  3. #include <stdio.h>
  4. #include <ctype.h>
  5. #include <string.h>
  6. #include <math.h>
  7. #include <stdlib.h>
  8. #include <stdbool.h>
  9. #include <limits.h>
  10. #include <time.h>
  11. #include <stddef.h>
  12. #include <float.h>
  13.  
  14. #define N 10000000
  15. #define PI 3.14
  16.  
  17. int main()
  18. {
  19.     long a, b, sum = 1, tmp = 0;
  20.  
  21.     scanf("%ld%ld", &a, &b);
  22.  
  23.     while (a + tmp <= b)
  24.     {
  25.         sum *= (a + tmp);
  26.         tmp += 1;
  27.     }
  28.  
  29.     if (sum < 0)
  30.     {
  31.         printf("Negative");
  32.  
  33.         return 0;
  34.     }
  35.  
  36.     if (sum == 0)
  37.     {
  38.         printf("Zero");
  39.  
  40.         return 0;
  41.     }
  42.  
  43.     if (sum > 0)
  44.     {
  45.         printf("Positive");
  46.  
  47.         return 0;
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement