about summary refs log tree commit diff
path: root/NTU/writer.c
diff options
context:
space:
mode:
authorNguyễn Gia Phong <vn.mcsinyx@gmail.com>2019-12-15 15:09:13 +0700
committerNguyễn Gia Phong <vn.mcsinyx@gmail.com>2019-12-15 15:09:13 +0700
commit9e28e4c7b67c54229df11d355047ac8a88ea1817 (patch)
tree0d9d40db69613c2c49564a3f1987a005d61f4db3 /NTU/writer.c
parent67393f42f41ab92219deb549f711121c4dab845b (diff)
downloadcp-9e28e4c7b67c54229df11d355047ac8a88ea1817.tar.gz
Normalize pathname
Diffstat (limited to 'NTU/writer.c')
-rw-r--r--NTU/writer.c52
1 files changed, 0 insertions, 52 deletions
diff --git a/NTU/writer.c b/NTU/writer.c
deleted file mode 100644
index 3227991..0000000
--- a/NTU/writer.c
+++ /dev/null
@@ -1,52 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-
-typedef char *string;
-
-const string KEYBOARD[10] = {"_0", ".,?!1", "abc2", "def3", "ghi4", "jkl5",
-                             "mno6", "pqrs7", "tuv8", "wxyz9"};
-struct Foo {
-	char num;
-	char times;
-};
-
-struct Foo get(char letter)
-{
-	struct Foo val;
-	char len;
-
-	for (val.num = 0; val.num < 10; val.num++) {
-		len = strlen(KEYBOARD[val.num]);
-		for (val.times = 0; val.times < len; val.times++)
-			if (KEYBOARD[val.num][val.times] == letter) {
-				val.times++;
-				return val;
-			}
-	}
-}
-
-int main()
-{
-	char t, i, s[50][1000];
-
-	scanf("%hhd", &t);
-	for (i = 0; i < t; i++)
-		scanf("%s", s[i]);
-
-	short time, j;
-	struct Foo f00;
-	char olechr;
-
-	for (i = 0; i < t; i++) {
-		time = 0;
-		olechr = 1;
-		for (j = 0; j < strlen(s[i]); j++) {
-			f00 = get(s[i][j]);
-			time += f00.times;
-			if (f00.num != olechr)
-				time++;
-			olechr = f00.num;
-		}
-		printf("%hd\n", time);
-	}
-}