This commit is contained in:
NaiJi ✨ 2024-04-18 03:31:45 +04:00
parent 5c799b0389
commit 39ac13eb36
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
#include <stdio.h>
#define NORMAL 0
#define SPACEBARING 1
main()
{
int c;
int state = NORMAL;
while ((c = getchar()) != EOF)
{
if (state == NORMAL)
{
putchar(c);
if (c == ' ')
state = SPACEBARING;
}
if (state == SPACEBARING)
{
if (c != ' ')
{
state = NORMAL;
putchar(c);
}
}
}
}