Compare commits
1 Commits
c072df226b
...
292266507d
Author | SHA1 | Date | |
---|---|---|---|
|
292266507d |
@ -1,22 +0,0 @@
|
||||
// vim: set ts=4 sw=4 et tw=80:
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
int main() {
|
||||
int c;
|
||||
bool in_space = true;
|
||||
unsigned int w = 0;
|
||||
while ((c = getchar()) != EOF) {
|
||||
if (isspace(c)) {
|
||||
if (!in_space) {
|
||||
w++;
|
||||
in_space = true;
|
||||
}
|
||||
} else {
|
||||
in_space = false;
|
||||
}
|
||||
}
|
||||
printf("%u\n", w);
|
||||
}
|
Reference in New Issue
Block a user