about summary refs log tree commit diff stats
path: root/1.6.c
diff options
context:
space:
mode:
Diffstat (limited to '1.6.c')
-rw-r--r--1.6.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/1.6.c b/1.6.c
new file mode 100644
index 0000000..4ed1550
--- /dev/null
+++ b/1.6.c
@@ -0,0 +1,20 @@
+#include <stdio.h>
+
+int main () {
+	int c, i, nwhite, nother;
+	int ndigit[10] = {0};
+	nwhite = nother = 0;
+
+	while ((c = getchar()) != EOF)
+		if (c >= '0' && c <= '9')
+			++ndigit[c-'0'];
+		else if (c == ' ' || c == '\n' || c == '\t')
+			++nwhite;
+		else
+			++nother;
+	printf("digits =");
+	for (i = 0; i < 10; ++i)
+		printf(" %d", ndigit[i]);
+	printf(". white space = %d, other = %d\n",
+			nwhite, nother);
+}
>2655d9e8 ^
f6ca1ba1 ^





a16c53f5 ^



2655d9e8 ^
7d6e64a5 ^







03dd5f58 ^



03dd5f58 ^

7d6e64a5 ^

03dd5f58 ^

5b769a3f ^

03dd5f58 ^
7ea02c71 ^
c588a118 ^

28f5cdf7 ^
2655d9e8 ^

8e0d8d2a ^

11066f20 ^
5b769a3f ^
03dd5f58 ^

11066f20 ^
6d329343 ^
c2e94bfb ^
2655d9e8 ^
b80bf037 ^
3c062438 ^



11066f20 ^

2655d9e8 ^





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75