自动删注释机:
#include <iostream>
#include <cstdio>
using namespace std;
char c, c2;
bool f;
int main() {
freopen("r", "in.cpp", stdin);
freopen("w", "out.cpp", stdout);
while (1) {
c = getchar();
if (c == EOF)
break;
if (c == '\n' && f) {
f = 0;
}
if (c == c2 && c == '/') {
f = 1;
}
if (!f) {
cout << c;
}
c2 = c;
}
return 0;
}