Advertisement
palmerstone

Untitled

Jun 14th, 2011
503
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <math.h>
  4. #include <ctype.h>
  5. #include <stdlib.h>
  6.  
  7. unsigned long long int compare(const void *a, const void *b)
  8. {
  9. return (*(unsigned long long int*)a - *(unsigned long long int*)b);
  10. }
  11.  
  12. unsigned long long int ar[100000];
  13. int main()
  14. {
  15. unsigned long long int t, i, j, k, l, a, b, c, d, x, y, z;
  16.  
  17. printf("1\n");
  18. k = 0;
  19. for (i = 2; i < 65536; i++)
  20. {
  21. x = i * i;
  22. y = x * x;
  23. ar[k] = y;
  24. k++;
  25. }
  26.  
  27. for (i = 2; i <= 138; i++)
  28. {
  29. x = i * i * i;
  30. y = x * x * x ;
  31. ar[k] = y;
  32. k++;
  33. }
  34.  
  35. for (i = 2; i < 16; i++)
  36. {
  37. x = i * i * i * i;
  38. y = x * x * x * x;
  39. ar[k] = y;
  40. k++;
  41. }
  42.  
  43. for (i = 2; i < 6; i++)
  44. {
  45. x = i * i * i * i * i;
  46. y = x * x * x * x * x;
  47. ar[k] = y;
  48. k++;
  49. }
  50.  
  51. for (i = 2; i <= 3; i++)
  52. {
  53. x = i * i * i * i * i * i;
  54. y = x * x * x * x * x * x;
  55. ar[k] = y;
  56. k++;
  57. }
  58.  
  59. for (i = 2; i < 3; i++)
  60. {
  61. x = i * i * i * i * i * i * i;
  62. y = x * x * x * x * x * x * x;
  63. ar[k] = y;
  64. k++;
  65. }
  66.  
  67. qsort(ar, k, sizeof(unsigned long long int), compare);
  68. /*for (j = k - 2; j >= 0; j--)
  69. {
  70. for (l = 0; l <= j; l++)
  71. {
  72. if (ar[l] > ar[l + 1])
  73. {
  74. a = ar[l];
  75. ar[l] = ar[l + 1];
  76. ar[l + 1] = a;
  77. }
  78. }
  79. }*/
  80.  
  81. for (j = 0; j < k; j++)
  82. {
  83. if (ar[j] != ar[j - 1])
  84. {
  85. printf("%llu\n", ar[j]);
  86. }
  87. }
  88.  
  89. //z = sizeof(unsigned long long int);
  90. //printf("%llu", z);
  91. return 0;
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement