1
2
3 #include <stdio.h>
4 #include <string.h>
5 #include <ctype.h>
6
7 fancy_input(p)
8 # 7
9 int p;
10 {
11 int n = 0;
12 int o = 0;
13 char c, buf[10];
14 extern char *command[52];
15
16 c = '\0';
17 for (n = 0; n <= 9; ++n)
18 {
19 buf[n] = '\0';
20 }
21
22 buf[0] = (char)getch();
23
24 c = toupper((int)(buf[0]));
25
26 o = p / 100;
27
28 for (n = o; n <= p - o * 100; ++n)
29 {
30 if (c == command[n - 1][0])
31 o = n;
32 }
33
34 for (n = 1; n <= strlen(command[o - 1])- 1; ++n)
35 {
36 printf ("%c",command[o - 1][n]);
37 }
38 printf ("\n");
39 return o;
40 }
41