C++ Programs

Pangram

Problem Statement
This problem is from the "North America Qualifier 2015 ACM International Collegiate Programming Contest".
A pangram is a phrase that includes at least one occurrence of each of the 26 letters, 'a'. . . 'z'. You're probably familiar with this one: "The quick brown fox jumps over the lazy dog."

Solution
The following program accepts a file and processes the file line by line and determine whether the line is pangram or not if it is pangram prints pangram or prints missing letters.

SOURCE CODE : Pangram.cpp
INPUT DATA : Pangram-data

Sample Input 1 Sample Output 1
The quick brown fox jumps over the lazy dog. pangram
Sample Input 2 Sample Output 2
ZYXW, vu TSR Ponm lkj ihgfd CBA. missing eq
Sample Input 3 Sample Output 3
.,?!'" 92384 abcde FGHIJ missing klmnopqrstuvwxyz

Secret

Problem Statement
This problem is from the "North America Qualifier 2015 ACM International Collegiate Programming Contest"
Jack and Jill developed a special encryption method, so they can enjoy conversations without worrrying about eavesdroppers. Here is how: let L be the length of the original message, and M be the smallest square number greater than or equal to L. Add (M - L) asterisks to the message, giving a padded message with length M . Use the padded message to fill a table of size K x K, where K 2 = M . Fill the table in row-major order (top to bottom row, left to right column in each row). Rotate the table 90 degrees clockwise. The encrypted message comes from reading the message in row-major order from the rotated table, omitting any asterisks.

Solution
This file process the file line by line and encrypts msgs as stated in the problem and outputs the encrypted msg.

SOURCE CODE : secret.cpp
INPUT DATA : secret-data

Sample Input 1 Sample Output 1
iloveyoutooJill
TheContestisOver
iteiloylloooJuv
OsoTvtnheiterseC