Current location - Health Preservation Learning Network - Slimming men and women - Who has C++ programming training questions, the more the better.
Who has C++ programming training questions, the more the better.
Class a-simple questions

A 1: design a menu program, select the number key 1~3 to output the regular triangle, inverted triangle and diamond in the middle of the screen respectively, and select the number 4 to end the operation and return to the operating system state.

A2: Establish an address book structure containing n students, and sort the n students by their names.

A3: Input three matrices from the keyboard and output the sum and product of the main diagonals of the three matrices.

A4: The left-right sorting of characters requires the compiler jsSort () to sort the strings according to the given conditions in line units, and the sorted results are still stored in the string array line by line. Sorting condition: the string is divided into two parts from the middle, and the left part is sorted in ascending order by ASCII code of characters. After sorting, the left half is exchanged with the right half. If the length of the original string is odd, the middle character does not participate in the processing and is still placed in the original position. For example, the original string: dcbahgfe 432 198765, and the processed string: hgfe abcd 87659 1234.

A5: The new complete square number finds qualified integers from three-digit integers (100 ~ 999) and stores them in the array from small to large. The specific condition is that it is both a complete square number and the same two-digit number, such as144,676, etc. It is required to return the integer and its number that meet this condition through the compiled function.

A6: There is a one-dimensional array containing 10 student scores, and the number of students in each score segment, average score, highest score and lowest score are output.

A7: Write a program to find the largest three digits in the divisor of 55555.

A8: Write a program to compare the size of two scores.

A9: Find such a three-digit number, which is equal to the sum of factorials of each digit.

A 10: finding rabbits. 1 year, there are 1 pairs of rabbits. From the third year after birth, each pair of rabbits can give birth to 1 pair of rabbits every year. The life span of rabbits is 6 years. How many pairs of rabbits are there in N years?

A 1 1: realize the clock program with c.

Class b-intermediate problem

B 1: design a menu program, select numeric keys 1 generate 10 [10, 100] random integers and sort them (5 in each row), select number 2 to find out whether there are any numbers in the array output from the keyboard, and select number 3 to return to the operating system state.

B2: Input a character string from the keyboard, convert the first letter of a word (the character string between two spaces) into uppercase letters, and output the original character string and all converted words until output? *? End conversion and output.

B3: Four operational problems. Randomly generate questions within the specified range and count the scores, and display the answer results, scores and correct answers of each question. (Each time 10 channel, 2 points for each channel)

B4: Enter several lines of text and output those lines containing the given word. For example, the input text is the expression exprl that is evaluated first. If non-zero (true), then the expression is given, but this is? Is it? The output is to evaluate the expression exprl first.

B5: To write a program to count students' scores, you need to input the scores of students in five courses 10, and calculate the average score of each student through a sub-function: (1); (2) The average score of each course; (3) Find out the students and homework corresponding to the highest score.

B6:。 Read text from a text file and count the number of occurrences of each number and other characters.

B7: Read the text from the text file, convert lowercase letters into uppercase letters, convert uppercase letters into lowercase letters, and leave other characters unchanged, and then output to another text file for saving.

B8: Develop a simple drawing program in C language environment. Develop a simple drawing program in C language environment to realize drawing points, lines and figures. Requirements: be able to execute programs and correctly complete the functions of drawing points, lines and diagrams. Group some functions and draw an image. There should be complete development documents, program description files, etc.

B9: Realize complex number operation in C language environment. Requirements: Programming to realize multiplication, division and power operation of complex numbers. Implemented in the form of program inclusion. Including functional analysis documents, program block diagrams, program description files, etc. It is extensible.

B 10: Developing simple structured applications in C language environment. Requirements: Programming to realize structured application and develop linked list. It has expansibility and further functions. Including functional analysis documents, program block diagrams, program description files, etc.

B 1 1: Implement various sorting algorithms in C language environment, and compare the advantages and disadvantages of sorting programs. Requirements: Implement various sorting algorithms and compare the advantages and disadvantages of sorting programs. Complete the comparison report.

B 12。 Part of the sorting needs to program the jsSort () function, arrange any number between1000 and 9999 in ascending order according to the size of the last three digits of each number, and then take out the top five numbers that meet this condition and store them in the array bb in turn. If the last three digits are equal, they are sorted in descending order according to the original values. For example, before treatment: 6012 5099 9012 7025 8088 After treatment: 9012 6012 7025 8088 5099.

B 13。 Triple palindrome number search and output the number m between 1 1 ~ 999, and the cube satisfying the sum of the squares of m is palindrome. The so-called palindromes refer to integers with symmetrical numbers, such as 12 1, 676, 94249, etc. Numbers that meet the above conditions, such as m= 1 1, have the square of 12 1, and have the cube of 133 1, are palindromes. The function int svalue(long m) is needed to realize this function. If it is a palindrome, the function returns 1, otherwise it returns 0. Output triple palindromes in the main function.

B 14。 Count the numbers that meet certain conditions, randomly type 200 4-digit numbers from the keyboard, and store these numbers in array A ... Write a function, the function is to count the number cnt that meets this condition if all the numbers in each of the four-digit numbers are 0 or 2 or 4 or 6 or 8, and store these four-digit numbers in array B in descending order.

B 15。 Count the number of 40 people who failed in four subjects (int) and output the list of students who failed. Use the pointer function find(pr) to judge whether there is a failing score. Pr is (*pr)[4]. If it fails, return the address of the first course in the current line; If it fails, return to the address of the first course on the next line.

B 16。 Write string functions strcpy, strcmp, strcat, strlen with pointers. And write a program to verify it.

B 17。 The score management system uses files and structures to realize the entry, query, modification and sorting of scores. B 18。 Address book management uses files, structures, etc. Realize the data entry, search, update, deletion and other functions of the address book.

B 19。 Quick calculation and oral calculation exercises every day can realize the functions of setting questions, marking papers, redoing wrong questions and saving test papers. You can choose the numerical range and operation symbol used in the question.

B20。 Functional requirements of student achievement management: a class offers four courses, namely Chinese, mathematics, politics and English. Designing a simple student achievement management system requires a simple interface, and the program segment should be divided into modules, so it is necessary to explain. Realize the input of class students' list and scores of all subjects, count the total score and average score, display the scores in a standard format according to the average score, insert students in designated positions, and modify or delete the scores of designated students.

B2 1。 Functional requirements of salary management: salary items include: department, employee number, name, basic salary, post allowance, seniority salary, utilities, paid salary, etc. Designing a simple salary management system requires a simple interface, and the program segment should be divided into modules, so it is necessary to explain it. Enter the employee list of each department and their salaries, make statistics on the salaries payable, display the salary list in the format of department sorting specification, insert the salaries of employees in designated positions, or modify or delete the salaries of designated employees.

B22。 Address book management function requirements: Address book entries include: serial number, name, work unit, telephone number, postal code, e-mail, etc. Designing a simple address book management system requires a simple interface, and it is necessary to distinguish and explain the modules in the program segment. Input address book data, display the contents of the address book in a standard format sorted by work unit, insert a person's data at a specified location, or modify or delete the data of a specified person.

B23。 Design function requirements of book information management system: To design a simple address book management system, it is required to have a simple interface, and the program segments should be divided into modules and explained. Book information includes: book title, author's name, classification number, publishing unit, publishing time, price, etc. Try to design a book information management system, so that it can provide the following functions: the system works in menu mode (book information input function (book information is saved as a file)-input (book information browsing function)-output (query and sorting function: (at least one query method)-algorithm (query by book title and query by author name (

B24: Write a program to input a character string from the keyboard, convert all lowercase letters into uppercase letters, and then output to a disk file "test" for saving.

B25: Auxiliary management of daily expenses. Using the C program environment, develop the management software of students' daily expenses. Requirements: (1) Be able to manage limited daily expenses, complete the functions of balance of payments, early warning of expenses, etc. (2) Keep a record of daily expenses. (3) The program is extensible.

B26: Personal daily file management. Applying C program environment, developing students' daily file management software. Requirements: (1) can manage limited daily documents (such as address book, personal information database, etc.). ) and complete information addition, query and other functions. (2) Save daily files. (3) The program is extensible.

B27: To write a program of students' scores, you need to input students' scores of five courses 10, and the output is sorted according to the selected course scores. You can select at most two sorted courses at the same time.

B28: General C program for analog calculator.

Given the year, month and day, calculate a day of the year. You need to write a function to calculate leap years and a function to calculate dates.

B30 Enter the scores of five students in four courses, and then calculate: (1) the total score of each student; (2) The average score of each course; (3) Output the name and total score of the student with the highest total score.

Class c-puzzle

C 1。 Generation of employee files and concise information. Requirements: The following four functions are provided in the form of menu: input 10 employee data, display original data, generate concise employee data (name and age) and display output, and delete concise employee data. These four functions can be operated continuously in a loop until entering 0 ends the operation and returns to the operating system state.

C2。 Student achievement management. Student information: name, gender, province, telephone number. Design a menu program, and select the number key 1~3 to realize it respectively: input the student information, delete the designated student and information and display the designated student information, and select the number 4 to return to the operating system state. (completed with documents)

C3。 Programming to find the inverse of any symmetric positive definite matrix.

C4。 Read text from one text file and output it to another text file. When outputting, multiple consecutive space characters and horizontal tabs are reduced to one character, and blank lines are deleted without outputting.

C5。 Write a program to encrypt a text file and a program to decrypt it. The password rules are: for lowercase letters, A is replaced by X, B by Y, C by Z, D by A, E by B, ...; For capital letters, A is replaced by X, B by Y, C by Z, D by A, E by B, ...; Other characters remain unchanged.

C6。 Developing a text editor in C language environment requires that you can open and save files. Edit function or other file operation functions can be appropriately added. Tip: Use the operation of reading and writing files to realize the function of opening and saving files. Knowledge points: file reading and writing.

C7。 To develop a command-line calculator with simple four operations in C language environment, it is required to provide two operands and an operator through command-line parameters, and then display the operation results. Because the command line parameters are all strings, and the operation needs numerical operands, it is necessary to convert the strings into corresponding numerical values. The prototypes of the functions are all in the header file stdlib.h

C8。 Requirements for developing a typing program in C language environment: After displaying Chinese or English article examples, users can practice typing against it, and after input, they can count the input time and correct rate. Tip: You can handle strings in reference books, and you need to further improve the interface and functions.

C9。 Requirements for Chinese text retrieval in C language environment: Develop a Chinese text (txt) retrieval program in C language environment, which can make simple statistics (such as the frequency of Chinese characters appearing in the text). The execution of this program can correctly complete the retrieval function of words, words and phrases. There should be a complete development document. It is extensible.

C 10。 Requirements for grade management in C language environment: enter the student number of a class and the grades of various courses. Save the input information with structure array to find out the average score of each student; Then sort by the average score and output the sorting result. It is extensible.

C 1 1。 To realize the addition and subtraction of long integers in C language environment, it is necessary to input two long integers (100 bits) to realize the addition and subtraction. It is extensible. Tip: You can handle strings in reference books, and you need further functions.

C 12。 String inversion: input several English sentences from the keyboard in line units, move the string contents to the left of all lowercase letters o in the string to the right of the string to be stored in line units, then delete lowercase letters o, and finally re-store the processed string line by line in the character array. For example, the original text is: you can create an index on any field. You have the right record. The result is: n any field. Yu Can created an index rd. You have the right record.

C 13。 Count the results of an exam, take M subjects (such as six subjects, Chinese, politics, mathematics, physics, chemistry and foreign languages), and n people take part (such as 10000). Statistical requirements; Everyone's total (total) average scores in all subjects are sorted by personal total scores, with the highest score ranking first. The final output table is shown below. Grade exam name: foreign language total score: politics, mathematics, physics, chemistry-. -Average score:

C 14。 Complete the addition of two super-long (less than 100) positive integers with array. In order to achieve high-precision addition, the positive integer m can be stored in a one-dimensional array of n (n > 1) elements, and each element of the array stores a decimal number, that is, the first element stores one bit and the second element stores ten bits. , and so on. In this way, the addition of super-long positive integers can be realized by bitwise addition of each element in the array.

C 15。 Write a ranking program. Input students' grades according to their serial numbers, and output students' rankings, ranking scores, the number of students in the same ranking and their student numbers in turn from high to low; Student numbers with the same name are output by peers, and at most 10 student numbers can be output in one line.

C 16。 Write a program, read the C language source program file "test8.c" on the disk, delete the comments in the program and display it.