65,208
社区成员
发帖
与我相关
我的任务
分享#include "stdafx.h"
#include <string>
#include <fstream>
#include <iostream>
#include <vector>
#include <iosfwd>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
string name;
double a;
int num=0;
char filename[]= "D:/id.txt";
char output[]="D:/output.txt";
ifstream fin;
ofstream fin1;
fin.open(filename);
fin1.open(output);
if (filename==NULL)
{
printf("error with filename");
}
while(!fin.eof())
{
fin>>name>>a;
fin1<<name<<endl;
}
fin.close();
fin1.close();
return 0;
}