Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <time.h>
- #include <iostream>
- #include <Windows.h>
- #include <sstream>
- #define WAT 4
- using namespace std;
- int zad1(char* w )
- {
- clock_t time;
- int cycle = 0;
- time = clock();
- while (true)
- {
- for (int i = 0; i < (1 << 8); i++)
- {
- int k = 0;
- for (int i = 0; i < (1 << 20); i++)
- {
- if (k % 2 == 0)
- {
- k += k + 1;
- }
- else
- {
- k--;
- }
- }
- k = 0;
- for (int i = 0; i < (1 << 20); i++)
- {
- if (k % 2 == 0)
- {
- k += k + 1;
- }
- else
- {
- k--;
- }
- }
- }
- //cout<<"watek: " << w << " cycle:" << cycle << endl;
- cycle ++;
- if (cycle == 5)
- {
- break;
- }
- }
- return clock() - time;
- }
- int main(int argc, char * argv[])
- {
- int t = zad1(argv[1]);
- cout << "num: " << argv[1] <<" "<< t << endl;
- return t;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement