File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 4
4
*
5
5
* */
6
6
7
+ //suggesting a newer approach found on internet
8
+ //concept is: do nothing if you meet more than 1 blankspaces or tab spaces or newlines or "anti word characters"
9
+ #include <stdio.h>
10
+ #define CTRL (x ) (x & 0x1f)
11
+ main ()
12
+ {
13
+ int c ;
14
+ while ((c = getchar ()) != EOF && c != CTRL ('d' ) )
15
+ {
16
+ if (c == ' ' || c == '\t' || c == '\n' || c == '-' )
17
+ {
18
+ putchar ('\n' );
19
+ while ((c = getchar ()) == ' ' || c == '\t' || c == '\n' || c == '-' )
20
+ {
21
+ ; //do nothing // we could actually skip the braces and just enter ; after closing the while's condition brackets
22
+ }
23
+ }
24
+ putchar (c );
25
+ }
26
+ }
27
+
28
+
29
+ /*
7
30
#include <stdio.h>
8
31
#define IN 1
9
32
#define OUT 0
@@ -24,4 +47,5 @@ int main (int argc, char *argv[]) {
24
47
else
25
48
putchar (c );
26
49
}
27
- }
50
+ }
51
+ * /
You can’t perform that action at this time.
0 commit comments