This repository has been archived on 2026-07-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
cmc/contests/1contest/3.cpp
T
2025-04-13 21:48:15 +03:00

36 lines
583 B
C++
Executable File

#include <iostream>
#include <string>
#include <cctype>
int main() {
int c;
c = getchar();
bool is_num = false;
while (c != EOF) {
if (c == '0' && !is_num) {
int old = c;
c = getchar();
if (!(c == EOF || !isdigit(c))) {
continue;
}
putchar(old);
} else if (isdigit(c)) {
is_num = true;
} else {
is_num = false;
}
putchar(c);
c = getchar();
}
if (c != '\n') {
putchar('\n');
}
return 0;
}