Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include "pch.h"
  2. #include <string>
  3. #include <iostream>
  4. #include <Windows.h>
  5. #include <algorithm>
  6. #include <cmath>
  7. using namespace std;
  8.  
  9. //int perestanovka(int m, int n)
  10. //{
  11. // int i, h;
  12. // if (i == m)
  13. // {
  14. // h = 1;
  15. // }
  16. //
  17. //}
  18.  
  19. int main()
  20. {
  21. int n = 10, i, m=0, f = 1, h = 1;
  22. int *o = new int[n];
  23. int *r = new int[n];
  24. while (h <= n)
  25. {
  26. o[h] = h;
  27. r[h] = o[h];
  28. h++;
  29. }
  30. i = n;
  31. h = 1;
  32. while (h <= n)
  33. {
  34. f = f * h;
  35. h++;
  36. }
  37. h = 0;
  38. while (m < (n - 1))
  39. {
  40. while (i > 2)
  41. {
  42. swap(o[i], o[i - 1]);
  43. i--;
  44. }
  45. cout << "o[" << 10 << "]" << o[10] << endl;
  46. i = n;
  47. m++;
  48. }
  49. //while (h<f)
  50. //{
  51. //
  52. //}
  53. //cout << f;
  54. return 0;
  55.  
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement