aboutsummaryrefslogtreecommitdiff
path: root/7.1/main.c
diff options
context:
space:
mode:
Diffstat (limited to '7.1/main.c')
-rw-r--r--7.1/main.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/7.1/main.c b/7.1/main.c
new file mode 100644
index 0000000..f210c39
--- /dev/null
+++ b/7.1/main.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+
+int main(int argc, char *argv[])
+{
+ char c;
+
+ if (!strcmp(argv[0], "lower"))
+ while ((c = getchar()) != EOF)
+ putchar(tolower(c));
+ else
+ while ((c = getchar()) != EOF)
+ putchar(toupper(c));
+
+ return 0;
+}