1.Generate three-digit numbers that are not repeated,1、2、3、4How many three-digit numbers can a number be composed of different and no repeated numbers? How many are they?2.The bonuses issued by the company are commissioned based on profits. profit(I)Less than or equal to10When the bonus is ten thousand yuan, the bonus can be withdrawn10%;
Profit is higher than10Ten thousand yuan, less than20When 10,000 yuan, it is lower than10The part of the 10,000 yuan10%Commission, higher than10The portion of 10,000 yuan can be increased7.5%;
20Ten thousand to come40When it is between ten thousand, it is higher than20The portion of 10,000 yuan can be increased5%;
40Ten thousand to come60When it is between ten thousand, it is higher than40The portion of 10,000 yuan can be increased3%;
60Ten thousand to come100When it is between ten thousand, it is higher than60The portion of 10,000 yuan can be increased1.5%;
Above100When ten thousand yuan, more than100The part of the 10,000 yuan1%Commission.
Enter the profit I of the month from the keyboard to find the total number of bonuses to be paid?
Program analysis: Please use the number axis to demarcate and locate. Pay attention to the definition of bonuses and grow the whole3.An integer, it adds100Then there is a perfect square number, plus168Another perfect square number, what is the number?4.Enter a certain day of a certain year, month and day to determine which day of this year?5.Enter three integers x,y,z, please output these three numbers from small to large.6.use*The number outputs the pattern of letter C.7.Output special pattern, please run it in C environment8.Output nine-nine multiplication table9.Requires the output of chess board.10.Print the stairs and print two smiling faces above the stairs at the same time.11.Classical question (rabbits give birth to cubs): There is a pair of rabbits, from the beginning of birth3From the beginning of the month, a pair of rabbits will give birth to each month. After the little rabbit grows to the third month, another pair of rabbits will give birth to each month. If the rabbits do not die, what is the total number of rabbits each month? (Before output40Just months)12.judge101arrive200prime number between.13.Print out all"Narcissus Number", so-called"Narcissus Number"It refers to a three-digit number whose digits are cubic sum equal to the number itself. For example:153It's one"Narcissus Number",because153=1The power of the third5The power of the third3to the third power.14.Decompose a positive integer to the prime factor. For example: input90,Print out90=2*3*3*5。
15.Use the nesting of conditional operators to complete this question: academic performance>=90The students with the score are represented by A.60-89The segments are represented by B.60The following are represented by C.16.Enter two positive integers m and n to find their greatest common divisor and their least common multiple.17.Enter a line of characters to count the number of English letters, spaces, numbers and other characters.18.Please s=a+aa+aaa+aaaa+aa...The value of a, where a is a number. For example2+22+222+2222+22222(At this time there are5Add up the numbers), the sum of several numbers is controlled by keyboard.19.If a number is exactly equal to the sum of its factors, this number is called"Finished". For example6=1+2+3.Programming to find out1000All completed numbers within.20.One ball from100The meter height falls freely, and after each landing, it jumps back to half of the original height; after falling, please wait for it to be in the first place.10How many meters passed in total when landing? The10How high is the rebound?21.The problem of monkey eating peaches: The monkey picked several peaches on the first day, and ate half of them immediately. It was not addicted, so I ate one more
The next morning, I ate half of the remaining peaches and ate another one. From now on, I ate every morning and the day before.
Half and one. Arrive10When I wanted to eat it again one more day, I saw that there was only one peach left. I would like to ask how many I picked on the first day.22.Two table tennis teams played, with three players each. Team A is,b,C three, Team B is x,y,z Three people. The competition list has been decided by drawing lots. Someone asked the players about the list of the competition. a said he did not compete with x, c said he did not compete with x,z-compare, please program to find out the list of players of the three teams.23.Print out the following pattern (diamond shape).*
***
*****
*******
*****
***
*Program analysis: First divide the figure into two parts, one rule in the first four lines, and one rule in the last three lines, using doubleforLoop, first layer control row, second layer control column.24.There is a sequence of scores:2/1,3/2,5/3,8/5,13/8,21/13...Find the preceding sequence20The sum of items.25.beg1+2!+3!+...+20!and.26.Use recursive method to find5!。
27.Using recursive function calls, the input5characters, printed in reverse order.28.have5I sat together and asked how old the fifth person was? He said he4Personally large2age. Ask a question4He said that he is better than the3Personally large2age. Asked the third person, and said it was better than the first one.2He is two years older. Ask a question2Personally, I'm two years older than the first person. Finally, he asked the first person and he said yes10age. How old is the fifth person?
Program analysis: Using the recursion method, recursion is divided into two stages: pushback and recursion. To know the age of the fifth person, you need to know the age of the fourth person, and so on, push it to the first person (10) push back.29.Give no more than5A positive integer of bits, requirements: 1. Find how many digits it is, 2. Print out each digit in reverse order.30.one5digit number, determine whether it is a palindrome number. Right now12321It is a palindrome number, the single digits are the same as ten thousand digits, and the ten digits are the same as thousands.31.Please enter the first letter of the day of the week to determine the day of the week. If the first letter is the same, continue to judge the second letter.32.Delete a specified letter in a string, such as: string"aca", delete the letter a in it.33.studyclrscr()Functions andgotoxy() (Implemented in Turbo C).34.Practice function calls.35.Invert string, such as string""Reversed to""。
36.beg100prime numbers within.37.right10sort the number.38.Ask for one3*3The sum of diagonal elements of matrix39.There is an array that has been sorted. Now enter a number and ask to insert it into the array according to the original rules.40.Output an array inversely.41.studystaticDefine the usage of static variables.42.Learn to useautoDefine the usage of variables.43.Learn to usestaticAnother use of .44.Learn how to use external.45.Learn to useregisterMethods to define variables.46.Macro #define command exercises.47.Macro #define command exercises2。
48.Macro #define command exercises3。
49.#ifComprehensive application of #ifdef and #ifndef.50.#include application exercises.51.Learn to use bitwise and&。
52.Learn to use bitwise or|。
53.Learn to use bitwise XOR^。
54.Customize an integer shift,Take an integer a starting from the right end4~7Bit.55.Learn to use bitwise inversion~。
56.Draw pictures and learn to use circles to draw circles.57.Draw pictures and learn to draw straight lines using line (implemented in Turbo C).58.Learn to use rectangle to draw squares. (Implemented in Turbo C).59.Drawing, comprehensive examples. (Implemented in Turbo C).60.Drawing, comprehensive examples2. (Implemented in Turbo C).61.Print out Yang Hui triangle (requires print out10OK).62.Learn to draw points by putpixel (implemented in Turbo C).63.Draw ellipse (implemented in Turbo C).64.Utilize ellipseandrectangle drawing (implemented in Turbo C).65.One of the most beautiful patterns (implemented in Turbo C).66.enter3Number of,b,c, output in size order.67.Input array, the largest exchange with the first element, the smallest exchange with the last element, and the output array.68.There are n integers, so that the preceding numbers are moved backwards by m positions in sequence, and the last m numbers become the front m numbers.69.There are n people in a circle and numbers are arranged in sequence. Start counting from the first person (from1arrive3Report numbers), any report3The person who left the circle and asked who was the number one left in the end was.70.Write a function to find the length of a string, enter the string in the main function, and output its length.71.writeinput()andoutput()Function input, output5Student data records.72.Create a linked list.73.Reverse output of a linked list.74.Connect two linked lists.75.Enter an integer and invert it to output.76.Write a function, and when input n is an even number, call the function to find it1/2+1/4+...+1/n,When input n is an odd number, call the function1/1+1/3+...+1/n(Using pointer functions)。
77.Fill in the blanks (pointers to pointers).78.Find the oldest person and output. Please find out what's wrong with the program.79.String sorting.80.There are piles of peaches on the beach,Five monkeys come to divide.The first monkey divided the pile of peaches into five equal parts,One more,This monkey threw one more into the sea,Take a portion,The second monkey divided the remaining peaches into five equal parts.,Another one,It also threw more one into the sea and took away a portion,third,fourth,The fifth monkey did this,How many peaches are there at least on the beach?81.809*??=800*??+9*??in??The double digit number represented, 809*??is four digits,8*??The result is a double digit number,9*??The result is3digit number. beg??The double digit number represented, and809*??The result afterward.82.Customize an octal to decimal83.beg0—7The odd numbers that can be composed84.An even number can always be expressed as the sum of two prime numbers.85.How many prime numbers can be9Divide.86.Two string concatenation programs.87.Answer result (Structural variable transfer).88.Read7Number of1—50) Integer value, each time a value is read, the program prints out the number of the value *.89.A company uses a public telephone to transmit data. The data is a four-digit integer, which is encrypted during the transmission process. The encryption rules are as follows: Each digit is added.5,Then use and divide10The remainder of the number replaces the number, and then exchanges the first and fourth digits, and the second and third digits.90.The results of the junior college to undergraduate.91.Example of time function1
92.Example of time function2
93.Example of time function3
94.Guessing game95.Simple structure application example.96.Calculate the number of times a substring appears in a string.97.Enter some characters from the keyboard and send them to disk one by one until you enter a #.98.Enter a string from the keyboard, convert all lowercase letters into uppercase letters, and then output to a disk file"test"Save in. Enter the string to! Finish.99.There are two disk files A and B,Each store one line of letters, requiring the information in these two files to be merged (alphabetical order) and output to a new file C.100.There are five students, each with3The grades of the course are entered from the keyboard (including student number, name, and grades of the three courses), and the average score is calculated, and the original data and the calculated average score are stored in the disk file."stud"middle.
Exercise answers
Classic 100 questions source code
recommend
Recently, I was picking up C and found several good learning websites. Ha ha
1.runoob
2.w3schoo
You can also move to the 100 classic cases of "C/C++ Language Programming" of my homepage column, which will be updated continuously. The first 30 cases are the basic part, and the last 70 cases are the improvement part, involving some common algorithms and data structure knowledge.