C++ 同时从2个文件读取数据
//FILE *stdin1; //FILE *stdin2; //freopen("D:/p/BB/11.txt", "r", stdin); //freopen("D:/p/BB/22.txt", "r", stdin2); freopen("D:/p/BB/1_2.txt", "w", stdout); FILE * fp1 = fopen("D:/p/BB/1.txt", "r"); FILE * fp2 = fopen("D:/p/BB/2.txt", "r"); double x, y; fscanf(fp1,"%lf",&x);//从输入文件读取一个整数 fscanf(fp2, "%lf", &y); //printf("%lf %lf \n", x, y);
东北日出西边雨 道是无情却有情