24 Nov Aurora Saturday 14:30 Python Practice 20.11.21.
Question 1:
Many advanced calculators have a fraction feature that will simplify fractions for you. You are to write a program that will accept for input a non-negative integer as a numerator and a positive integer as a denominator, and output the fraction in simplest form. That is, the fraction cannot be reduced any further, and the numerator will be less than the denominator. You can assume that all input numerators and denominators will produce valid fractions.
Sample Input 1 28 7 Sample Output 1 4
Sample Input 2 13 5 Sample Output 2 2 3/5
Sample Input 3 0 7 Sample Output 3 0
Sample Input 4
55
10
Sample Output 4
5 1/2
Question 2:
A simple poem consists of one or more four-line verses. Each line consists of one or more words consisting of upper or lower case letters, or a combination of both upper and lower case letters. Adjacent words on a line are separated by a single space.
We define the last syllable of a word to be the sequence of letters from the last vowel (a, e, i, o or u, but not y) to the end of the word. If a word has no vowel, then the last syllable is the word itself. We say that two lines rhyme if their last syllables are the same, ignoring case.
You are to classify the form of rhyme in each verse. The form of rhyme can be perfect, even, cross, shell, or free:
The first line of the input file contains an integer N, the number of verses in the poem, 1≤N≤5. The following 4N lines of the input file contain the lines of the poem. Each line contains at most 80 letters of the alphabet and spaces as described above.
The output should have N lines. For each verse of the poem there should a single line containing one of the words perfect, even, cross, shell or free describing the form of rhyme in that verse.