D-Day has been one of the most important days of war history. It started on June 6, 1944. Without it, it’s likely that World War 2 would have resulted in a German victory. However, this day creates a question that is very important. How did D-Day lead to victory for…
learning
Why do People Sneeze?
People sneeze when there are a certain number of irritants in the person’s throat or nose. Many people often sneexe multiple times before stopping, because one sneeze wouldn’t be enough to get rid of all the dust particles. So, another sneeze occures. Reasearchers aren’t exactly sure, but that is what…
CCC ’18 J4 (S2)
Matrices are among an important group in coding problems. Matrix rotations are also vital. For instance, QR codes can be read even when it is rotated 90°. Take the coding problem below as an example: https://dmoj.ca/problem/ccc18s2 This is a matrix problem. At first glance, people might thnk that the data…
Atbash Cipher
This type of cipher is one of the easiest because each encoded letter could only be another. It is also known as the mirror cipher, because A=Z, B=Y, C=X, and so on. This type is best to do a key, and it is below: Here is a code in Atbash:
Caesar Cipher
This type of cipher is one of the most modern and ancient types. A message is encoded by shifting the alphabet by a certain number of times. Then, the new alphabet is put. For instance, in a shift of 1, A=B, B=C, and so on, all the way to Z=A….
Cryptography
Cryptography is the study of codes, encoding them, and decoding them. It is useful in wars, when sodiers want to send messages to each other. To avoid enimies intercepting and reading the message, senders would decrypt them with some type of format, such as Caesar Cipher. See if you can…
Test For No Errors!
Remember: in C++, a frequent thing that needs to be done is to test (use debugging code) to check that there are no mistakes. Why? Mistakes could be solved easily, but if there are too many all of them would be hard to solve. Plus, if an entire program was…
CCC ’21 J4 – Solution
Arranging Books is a coding problem that can be viewed here. It isn’t easy, and is literally impossible to solve it correctly by actually swapping books. Here is the problem: Canadian Computing Competition: 2021 Stage 1, Junior #4 Valentina wants books on a shelf to be arranged in a particular…
C++ substr()
In C++, the substr() method is one of the easiest functions to use to split a string into multiple slices. Here are the parameters of the substr(): where name is the string that you want to be sliced, position is the staring point, and len is the number of characters…
How to Find if a Number is Divisible by Another (Up to 20)
1: Yes. 2: Examine the last digit of N. If it is an even number, then N is divisible by 2. 3: Add the sum of the digits of N and call it P. If P is divisible by 3, than N is divisible by 3. 4: Take the last…
