Guest User

Untitled

a guest
Nov 16th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. For c and c++ try this-
  2.  
  3. Create a file named input.txt in the same folder as your solution program(.c or .cpp file) is in.
  4. Then modify your code this way-
  5.  
  6. // your include statemnts
  7. #include<time.h>
  8. #include<stdio.h>
  9.  
  10. int main()
  11. {
  12.     freopen("input.txt","r",stdin);
  13.     double start=clock();
  14.     /*
  15.  
  16.         your solution code here
  17.  
  18.     */
  19.     double end=clock();
  20.     printf("\n\nTotal runtime = %lf ms",(end-start)*1000/CLOCKS_PER_SEC);
  21.     return 0;
  22. }
  23.  
  24. Now compile and run the program.
  25.  
  26. # Don't forget to remove the freopen(...) statement before submitting your code
Add Comment
Please, Sign In to add comment