Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #include <time.h>
  2. #include <iostream>
  3. #include <Windows.h>
  4. #include <sstream>
  5. #define WAT 4
  6.  
  7. using namespace std;
  8. int zad1(char* w )
  9. {
  10. clock_t time;
  11. int cycle = 0;
  12. time = clock();
  13. while (true)
  14. {
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21. for (int i = 0; i < (1 << 8); i++)
  22. {
  23. int k = 0;
  24. for (int i = 0; i < (1 << 20); i++)
  25. {
  26. if (k % 2 == 0)
  27. {
  28. k += k + 1;
  29. }
  30. else
  31. {
  32. k--;
  33. }
  34. }
  35.  
  36. k = 0;
  37. for (int i = 0; i < (1 << 20); i++)
  38. {
  39. if (k % 2 == 0)
  40. {
  41. k += k + 1;
  42. }
  43. else
  44. {
  45. k--;
  46. }
  47. }
  48. }
  49.  
  50.  
  51.  
  52.  
  53.  
  54. //cout<<"watek: " << w << " cycle:" << cycle << endl;
  55. cycle ++;
  56. if (cycle == 5)
  57. {
  58. break;
  59. }
  60. }
  61.  
  62. return clock() - time;
  63. }
  64.  
  65.  
  66.  
  67.  
  68.  
  69. int main(int argc, char * argv[])
  70. {
  71. int t = zad1(argv[1]);
  72. cout << "num: " << argv[1] <<" "<< t << endl;
  73. return t;
  74.  
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement