SHARE
TWEET

Untitled

a guest Oct 21st, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifdef _MSC_VER
  2. #define _CRT_SECURE_NO_WARNINGS
  3. #endif
  4.  
  5. #include <stdio.h>
  6. #include<stdlib.h>
  7.  
  8. int main(int argc, char* argv[])
  9. {
  10.     unsigned long lStart, lEnd, n;
  11.  
  12.     //lStart = atol(argv[1]);
  13.     //lEnd = atol(argv[2]);
  14.     //n = atol(argv[3]);
  15.  
  16.     lStart = 1;
  17.     lEnd = 50;
  18.     n = 3;
  19.  
  20.     int no_numbers = (lEnd - lStart + 1) / n;
  21.     printf("%d\n", no_numbers);
  22.  
  23.     for (int j = 0; j < n - 1; j++) {
  24.         printf("%d %d\n", (int)lStart + j * no_numbers, (int)lStart + (j + 1) * no_numbers - 1);
  25.     }
  26.  
  27.     printf("%d %d\n", (int)lStart + (n - 1) * no_numbers, (int)lEnd);
  28.     return 0;
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top