NetEase Cloud Classroom _c Language Programming Advanced _ Final Exam programming Questions part

Source: Internet
Author: User

123123

1 string Loop right Shift (5 points)

Topic content:

Entering a string and a non-negative integer n requires that the string loop be shifted right n times.

Input format:

The input gives a string in line 1th, ends with ' # ', ' # ' is not part of the string, the length of the string is unknown, but there is at least one character, and the 2nd line of the input gives a nonnegative integer n.

Output format:

Outputs a string in a row after the loop is shifted right n times.

Input Sample:

Hello world!#

2

Sample output:

D! Hello Worl

time limit: 500ms memory limit: 32000kb2 Minimum bounding rectangle (5 points)

Topic content:

Given a set of two-dimensional coordinates, a sequence of coordinates representing a contiguous vertex of a polygon within a Cartesian coordinate system. Calculates the smallest rectangle that encloses the polygon, parallel to the axis, and outputs the coordinates of its lower-left and upper-right corners.

Input format:

The first line is a positive integer n represents the number of vertices, the second row is an n set of integers, which in turn represents the x and Y values for each vertex coordinate.

Output format:

Four integers, which in turn represent the X, y, and y values of the coordinates of the lower-left corner of the computed rectangle.

Input Sample:

5

1 1 1 4 3 7 4 4 4 1

Sample output:

1 1 4 7

time limit: 500ms memory limit: 32000kb3 large number calculation (20 points)

Topic content:

A large number will not be able to use an int or a long long type of direct calculation, with double can not guarantee the accuracy of what, so, you have to write the program to calculate. Your program has to read in two large numbers, in the range of

And then your program calculates their and, the difference and the output.

Input format:

Two lines, one number per line.

Output format:

Three lines, one number per line, followed by the number of the input and, the difference and product.

Input Sample:

1853244628050278

506996688545785164

Sample output:

508849933173835442

-505143443917734886

939588889486756266731803978475592

time limit: 1000ms memory limit: 64000kb4 Score comparison (10 points)

Topic content:

A program is required to compare the size of two fractions.

Input format:

The input gives a rational number in the form of "A1/b1 a2/b2" in a row of two fractions, where the numerator and denominator are all positive integers within the range of int types.

Output format:

The relationship of two rational numbers is output in a row according to the format "A1/B1-a2/b2". where ">" means "Greater than", "<" means "less than", "=" means "equals".

Notice that there is a space before and after the relationship character.

Input Sample:

1/2 3/4

Sample output:

< 3/4

time limit: 500ms memory limit: 32000kb

1231

NetEase Cloud Classroom _c Language Programming Advanced _ Final Exam programming Questions part

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.