Second experiment Report of C language

Source: Internet
Author: User

1. Experimental topicsProblem 1:11-7 Find Saddle point (20 points)

The "Saddle point" of a matrix element refers to the value of the element at that position that is the largest on the row and the smallest on that column.

In this subject, we need to write a program to find the saddle point of a given N-Order square

Topic 2:12-8 Delete repeating characters

The main requirement is to write the program, after the given string to remove the duplicate characters, according to the character ASCII sequence from small to large after the output.

  Question 3:13-5 judgment palindrome string (20 points)

The need to write a function to determine whether a given string of characters is a "palindrome". The so-called "palindrome" refers to both reading and reading the same string. such as "Xyzyx" and "Xyzzyx" are palindrome.

  Question 4:14-8 string sort (20 points)

The main requirement is to write a program that reads 5 strings and outputs them in order from small to large.

The 5:15-3 function implements a string reverse order (20 points)

A simple function that requires the implementation of a string in reverse order. function f to p reverse the string that is pointed to. fYou cannot define any array in a function, and you cannot call any string-handling functions.

2. Design Ideas

11-7 Find a saddle point

    Through the two-dimensional array for loop nesting to achieve, to meet his requirements of the saddle point, divides it into two parts, there is only one point, must be the saddle point, if more than one value, find the maximum value, the array elements compare, if larger than a[i][k], then the array column is assigned to K, and then determine whether the column minimum value, If the maximum value of this row is not the lowest value of the column, assign the small row label to Y

  

12-8 Delete repeating characters

    Use the gets () function to implement long string reads. Use the strlen () function to calculate the length of the string. removes repeating characters through a for-loop nesting implementation. Sorts the remaining characters in ASCII order by selecting sort.

13-5 judging a palindrome string

The string is divided into two parts, the first part from small to large arrangement, the second part from large to small arrangement, at the corresponding character position equal that the string is a palindrome string.

  14-8 string Sorting

    Use the Sort method to compare strings between arrays and sort them from small to large.

  The 15-3 function implements string reversal.

    + + + with two-time for loop--operation in turn

two. SOURCE program (only the most critical parts can be intercepted)

Topic 1:11-7 Find a saddle point

Topic 2:12-8 Delete repeating characters

Topic 3:13-5 Judging Palindrome string

Topic 4:14-8 String Sorting

Title 5:15-3 function implements string reversal

three. Problems encountered and solutions, experience

Problem solving process may encounter a lot of problems, when we should sink down to the book or check data to solve them, the most important thing is to practice, more dozen code!

Second experiment Report of C language

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.