#include <stdio.h>
int main(void) {
int c;
int count;
int sp;
count = 0;
sp = 0;
while (1) {
if (c == ' ') {
count++;
} else if (c == '\t') {
count++;
} else if (c == '\n') {
count++;
}
if (sp) {
if (c == ' ') {
/* none */
} else {
sp = 0;
}
} else {
if (c == ' ') {
sp = 1;
} else {
}
}
if (c == '\n') {
break;
}
}
printf("count : %d\n", count
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CglpbnQgYzsKCWludCBjb3VudDsKCWludCBzcDsKCQoJY291bnQgPSAwOwoJc3AgPSAwOwoJCgl3aGlsZSAoMSkgewoJCWMgPSBnZXRjaGFyKCk7CgkJCgkJaWYgKGMgPT0gJyAnKSB7CgkJCWNvdW50Kys7CgkJfSBlbHNlIGlmIChjID09ICdcdCcpIHsKCQkJY291bnQrKzsKCQl9IGVsc2UgaWYgKGMgPT0gJ1xuJykgewoJCQljb3VudCsrOwoJCX0KCQkKCQlpZiAoc3ApIHsKCQkJaWYgKGMgPT0gJyAnKSB7CgkJCQkvKiBub25lICovCgkJCX0gZWxzZSB7CgkJCQlzcCA9IDA7CgkJCQlwdXRjaGFyKGMpOwoJCQl9CgkJfSBlbHNlIHsKCQkJaWYgKGMgPT0gJyAnKSB7CgkJCQlzcCA9IDE7CgkJCQlwdXRjaGFyKGMpOwoJCQl9IGVsc2UgewoJCQkJcHV0Y2hhcihjKTsJCQoJCQl9CgkJfQoJCQoJCWlmIChjID09ICdcbicpIHsKCQkJYnJlYWs7CgkJfQoJfQoJCglwcmludGYoImNvdW50IDogJWRcbiIsIGNvdW50KTsKCQoJcmV0dXJuIDA7Cn0=