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);

  

posted @ 2020-10-06 10:59  楼主好菜啊  阅读(997)  评论(0编辑  收藏  举报