Advertisement
dmkozyrev

create_points.cpp

Jan 16th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <fstream>
  2. #include <time.h>
  3. #include <stdlib.h>
  4.  
  5. using namespace std;
  6.  
  7. int rand_number(int a, int b){return (rand()%(b-a+1)+a);}
  8.  
  9. int main(){
  10.     srand(time(0));
  11.     ofstream fout("in.txt");
  12.     for(int i = 0, a = -5, b = 5, N = 10; i < N; i++)
  13.         fout << rand_number(a, b) << " " << rand_number(a, b) << endl;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement