Sweety

Practice makes perfect

导航

最简单随机生成数(文件输入输出)

Posted on 2014-10-20 21:56  蓝空  阅读(153)  评论(0编辑  收藏  举报

 

#include <iostream>
#include <cstdlib>
#include <ctime>
#include <fstream>
using namespace std;
int  main()
{
  ofstream out ("D:\zhang\\output.txt");
   int n=1000;
    srand((unsigned)time(NULL));
    int x;
    while(n-->0)
		out<<' '<<rand()%10;

}