求条
  • 板块灌水区
  • 楼主CuteGirlGC
  • 当前回复7
  • 已保存回复8
  • 发布时间2024/7/10 15:40
  • 上次更新2024/7/10 16:36:04
查看原帖
求条
681755
CuteGirlGC楼主2024/7/10 15:40

自动删注释机:

#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;
}
2024/7/10 15:40
加载中...