mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-05-10 08:10:27 +08:00
23 lines
258 B
C++
23 lines
258 B
C++
#include <iostream>
|
|
using namespace std;
|
|
|
|
int main()
|
|
{
|
|
char ch;
|
|
int space = 0;
|
|
while(ch != '\n')
|
|
{
|
|
ch = getchar();
|
|
if(ch == ' ' && space == 0)
|
|
{
|
|
putchar(ch);
|
|
space = 1;
|
|
}
|
|
if(ch != ' ')
|
|
{
|
|
space = 0;
|
|
putchar(ch);
|
|
}
|
|
}
|
|
return 0;
|
|
} |