使用了文件操作
直接上代码
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<fstream>
#include<time.h>
#include<math.h>
#include<algorithm>
using namespace std;
int main(){
int n;
int c;
int i;
double h;
h = (pow(2,101)/1024/1024);
c=100;
n=10;
FILE *fp;
fp = fopen("file out.txt","w");
fprintf(fp,"%d %d\n",c,n);
for(i=0;i<n-1;i++){
fprintf(fp,"%d ",rand());
}
fprintf(fp,"%d\n",rand());
fclose(fp);
return 0;
}
输出:
100 10
41 18467 6334 26500 19169 15724 11478 29358 26962 24464