質問編集履歴
1
書式の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,27 +10,43 @@
|
|
10
10
|
|
11
11
|
```
|
12
12
|
|
13
|
-
There is a trick to encrypt the data and use a word as its key. Here's
|
13
|
+
There is a trick to encrypt the data and use a word as its key. Here's
|
14
|
+
|
15
|
+
how it works: First, choose a word as the key, such as TRAILBLAZERS. If
|
16
|
+
|
17
|
+
the word contains repeated letters, only the first one is kept, and the
|
18
|
+
|
19
|
+
rest are discarded. Now, the modified word is listed below the alphabet,
|
20
|
+
|
21
|
+
as shown below:
|
14
22
|
|
15
23
|
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
|
16
24
|
|
17
25
|
T R A I L B Z E S
|
18
26
|
|
19
|
-
Then arrange the letters in the alphabet that do not appear in the
|
27
|
+
Then arrange the letters in the alphabet that do not appear in the
|
28
|
+
|
29
|
+
modified word after the modified word to get the coding table:
|
20
30
|
|
21
31
|
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
|
22
32
|
|
23
33
|
T R A I L B Z E S C D F G H J K M N O P Q U V W X Y
|
24
34
|
|
25
|
-
Therefore, based on the key of TRAILBLAZERS, if our original message is
|
35
|
+
Therefore, based on the key of TRAILBLAZERS, if our original message is
|
26
36
|
|
37
|
+
ATTACK, it will be encrypted as TPPTAD.
|
38
|
+
|
27
|
-
Input requirements: input key and original information, output encrypted
|
39
|
+
Input requirements: input key and original information, output encrypted
|
40
|
+
|
41
|
+
information
|
28
42
|
|
29
43
|
Example 1: Input TRAILBLAZERS ATTACK and output TPPTAD.
|
30
44
|
|
31
45
|
|
32
46
|
|
33
|
-
Input : Enter a line, including the input key and the original
|
47
|
+
Input : Enter a line, including the input key and the original
|
48
|
+
|
49
|
+
information (both capital letters), separated by spaces.
|
34
50
|
|
35
51
|
|
36
52
|
|
@@ -46,13 +62,19 @@
|
|
46
62
|
|
47
63
|
```
|
48
64
|
|
49
|
-
1. The data is opened too small, resulting in access to a memory area
|
65
|
+
1. The data is opened too small, resulting in access to a memory area
|
66
|
+
|
67
|
+
that should not be accessed
|
50
68
|
|
51
69
|
2. A division by zero error occurs
|
52
70
|
|
53
|
-
3. A large array is defined in the function, causing the program stack
|
71
|
+
3. A large array is defined in the function, causing the program stack
|
54
72
|
|
73
|
+
area to be exhausted
|
74
|
+
|
55
|
-
4. The pointer is used incorrectly, resulting in access to a memory area
|
75
|
+
4. The pointer is used incorrectly, resulting in access to a memory area
|
76
|
+
|
77
|
+
that should not be accessed
|
56
78
|
|
57
79
|
5. It is also possible that the program throws an unreceived exception
|
58
80
|
|