aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--1-09_single-spacing.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/1-09_single-spacing.c b/1-09_single-spacing.c
index 82447ee..4bf802a 100644
--- a/1-09_single-spacing.c
+++ b/1-09_single-spacing.c
@@ -15,8 +15,10 @@ int main(void) {
int spaces = 0;
while ((c = getchar()) != EOF) {
- if (c == ' ' && spaces == 0) {
- putchar(c);
+ if (c == ' ') {
+ if (spaces == 0) {
+ putchar(c);
+ }
spaces++;
} else {
putchar(c);