Skip to content

Commit b2c17bc

Browse files
committed
fix formatting
1 parent 73f647b commit b2c17bc

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

chapter_1/exercise_1_12/copy_io_nl.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
#include <stdio.h>
2-
3-
int main()
4-
{
5-
char c;
6-
char last_char = -1;
7-
while ((c = getchar()) != EOF) {
8-
if(c==' ' || c=='\t' || c=='\n'){
9-
if(last_char!=' ' && last_char!='\t' && last_char!='\n'){
10-
putchar('\n');
11-
}
12-
}
13-
else {
14-
putchar(c);
15-
}
16-
last_char=c;
17-
}
18-
}
1+
#include <stdio.h>
2+
3+
int main()
4+
{
5+
char c;
6+
char last_char = -1;
7+
while ((c = getchar()) != EOF) {
8+
if(c==' ' || c=='\t' || c=='\n'){
9+
if(last_char!=' ' && last_char!='\t' && last_char!='\n'){
10+
putchar('\n');
11+
}
12+
}
13+
else {
14+
putchar(c);
15+
}
16+
last_char=c;
17+
}
18+
}

0 commit comments

Comments
 (0)