Guest User

Untitled

a guest
Nov 16th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 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. Copy and paste the testcases in this file and then save the file.
  4. Now 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