Advertisement
Guest User

yeah

a guest
Dec 15th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <ctime>
  4. #include <cstdlib>
  5. using namespace std;
  6. ofstream ofs("problema.in");
  7. int main()
  8. {
  9. double d=clock();
  10. int minim=-100, maxim=100, n=1000000;
  11. srand(time(NULL));
  12. ofs<<n<<"\n";
  13. for(int i=0; i<n; i++)
  14. {
  15. int l = rand()*rand();
  16. l=minim+l%(maxim-minim+1);
  17. ofs<<l<<" ";
  18. }
  19. cout<<(clock()-d)/CLOCKS_PER_SEC<<"s";
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement