| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 14777 | Graphic Rotation |
|
| 14778 | Plural Forms |
|
| 14779 | Word Similarity Judgment |
|
Description
Write a program to rotate a pattern. The pattern consists of n rows and m columns of numbers or letters.
The program must rotate the pattern three times and print the result after each rotation.
The input contains n lines, each with m consecutive numbers or letters.
The program must process all characters until EOF.
The output should contain four versions of the pattern:
-
the original pattern, and
-
three more patterns obtained by rotating the original one clockwise each time.
Input
N lines, each with m consecutive numbers or letters.
Ex. 01
ab
27
Output
Four versions of the pattern:
-
the original pattern, and
-
three more patterns obtained by rotating the original one clockwise each time.
Ex. 01
ab
27
2a0
7b1
72
ba
10
1b7
0a2
Sample Input Download
Sample Output Download
Discuss
Description
Write a program that converts English nouns to their plural forms according to the rules below.
Note: these rules apply only for this problem and are not guaranteed to be 100% accurate for English in general.
Rules:
-
If a noun ends with
ch,sh,s,z, orx, addes.
Example: the plural ofboxisboxes. -
If a noun ends with
y, examine the letter before they.-
If the preceding letter is a vowel (
a,e,i,o,u), simply adds.
Example: the plural oftoyistoys. -
If the preceding letter is not a vowel, replace
ywithies.
Example: the plural ofstoryisstories.
-
-
For all other nouns, just add
s.
Constraints:
-
0 < n <= 80
Input
Each line contains a lowercase English word of length at most n.
The program must process all input until EOF.
Ex.box
toy
story
car
Output
For each input word, output its plural form according to the rules above.
Ex.boxes
toys
stories
cars
Sample Input Download
Sample Output Download
Discuss
Description
Write a program to determine whether two words are similar.
Two words are considered similar if either of the following conditions is true:
-
The two words have the same length, and by swapping two consecutive characters in one of the words, we can obtain the other word.
For example, best and bets are similar because if we swap the characters s and t in “best,” we get “bets.” -
The two words differ in length by one, and by deleting one character from the longer word, we can obtain the shorter one.
For example, best and bet are similar because if we delete the s from “best,” we get “bet.”
Each line of input contains two words to be compared.
The program must process all input until EOF.
The maximum word length is n, where 0 < n ≤ 80.
If a pair of words is similar, output yes; otherwise, output no.
Input
Two words.
The program must process all input until EOF.
(The maximum word length is n, where 0 < n ≤ 80.)
Output
If a pair of words is similar, output yes; otherwise, output no.