#include//我要实现从一个cpp文件中删去 /* / 之间的注释内容 威慑么会失败了
#include
using namespace std;
int main()
{
char ch;
ifstream re("g:\编程\c++\josephus环\josephus环\josephus.cpp",ios::in);
fstream co("g:\编程\liuq.cpp",ios::out);
while(re.get(ch))
{
if(!re)
{
cout<<"eror"<<endl;
abort();
}
if(!co)
{
cout<<"eror"<<endl;
abort();
}
if(ch=='\')
{
re.get(ch);
if(ch=='')
while(10)
{
re.get(ch);
if(ch=='*')
{
re.get(ch);
if(ch=='\') //在这里出错(空白) 去掉括号有种情况会没被考虑到、/******/这种
{
re.get(ch);
goto l;
}
}
}
}
l:
co.put(ch);
}
re.close();
co.close();
getchar();
return 0;
}