Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2010
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <stdlib.h>
  4. #include <string>
  5. #include <ctime>
  6.  
  7. #include <math.h>
  8. using namespace std;
  9.  
  10. # define NUM 711 // change to 756
  11.  
  12. int main () {
  13. char input;
  14. clock_t clock_start, clock_end;
  15. clock_start = clock();
  16. for (int i = 1; i < NUM-2; i++)
  17. for (int j = i; i+j < NUM-1; j++)
  18. for (int k = j; i+j+k < NUM; k++)
  19. if (i*j*k*(NUM-i-j-k) == NUM * 1000000)
  20. cout << "i = " << i << " j = " << j << " k = " << k << " l = " << NUM-i-j-k << endl;
  21.  
  22. clock_end = clock();
  23. cout << "Finished!!" << endl;
  24. cout << "Clock Ticks = " << clock_end-clock_start << " ticks" << endl;
  25. cout << "Clocks Per Second = " << CLOCKS_PER_SEC << endl;
  26. cin >> input;
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement