Rabbit reproduction problem C language _100 basic exercises of C language are coming! See if you can make it all?

2b92dccac702b8d328805f023ae6e567.png

Question 1: With 1, 2, 3, and 4 numbers, how many three-digit numbers can be formed that are different from each other and have no repeating numbers? How many?

Question 2: The bonuses issued by the company are based on profits.

When the profit (I) is less than or equal to 100,000 yuan, the bonus can be withdrawn by 10%;

When the profit is higher than 100,000 yuan, and less than 200,000 yuan, the part below 100,000 yuan will be commissioned by 10%, and the part above 100,000 yuan can be commissioned by 7.5%;

When it is between 200,000 and 400,000, the portion higher than 200,000 can receive a 5% commission;

For the portion between 400,000 and 600,000 that is higher than 400,000 yuan, 3% can be commissioned;

When it is between 600,000 and 1 million, the portion higher than 600,000 can get a 1.5% commission;

When it is higher than 1 million yuan, the portion exceeding 1 million yuan will be commissioned at 1%.

Enter the current month's profit I from the keyboard, and find the total number of bonuses that should be issued?

Question 3: An integer, it is a perfect square number after adding 100, and adding 168 is a perfect square number, what is the number?

Question 4: Enter a certain month and a certain day of a certain year, and determine which day of the year this day is?

Question 5: Input three integers x, y, z, please output these three numbers from small to large.

Question 6: Use * to output the pattern of the letter C.

Question 7: As shown in the figure, output the following special pattern

454514cb7e410f6806014af6aa6f4dda.png
C language

Question 8: Output the 9*9 formula

Question 9: As shown in the figure, it is required to output a chess board.

fd12139be4ca249103c2762c7901e5d8.png
C language

Topic 10: Print the stairs and print two smiling faces above the stairs at the same time.

Topic 11: Classical problem (rabbits give birth to cubs): There is a pair of rabbits, and they give birth to a pair of rabbits every month from the 3rd month after birth. If the rabbits don't die, what is the total number of rabbits per month? (The first 40 months can be output)

Question 12: Determine the prime numbers between 101 and 200.

Question 13: Print out all the "daffodils numbers". The so-called "daffodils numbers" refers to a three-digit number whose cubic sum of the digits is equal to the number itself. For example: 153 is a "daffodil number" because 153=1 cubed + 5 cubed + 3 cubed.

Problem 14: Decompose a positive integer into prime factors. For example: input 90, print out 90=2*3*3*5.

Question 15: Use the nesting of conditional operators to complete this question: students with grades >= 90 are represented by A, those with scores between 60 and 89 are represented by B, and those with scores below 60 are represented by C.

Question 16: Input two positive integers m and n, and find their greatest common divisor and least common multiple.

Question 17: Enter a line of characters and count the number of English letters, spaces, numbers and other characters in it.

bd63ac20e5012b07f93b4ae69dff8650.gif
C language

Problem 18: Find the value of s=a+aa+aaa+aaaa+aa...a, where a is a number. For example, 2+22+222+2222+22222 (there are 5 numbers added at this time), and the addition of several numbers is controlled by the keyboard.

Question 19: A number is called a "complete number" if it is exactly equal to the sum of its factors. For example, 6=1+2+3. Program to find all perfect numbers within 1000.

Question 20: A ball falls freely from a height of 100 meters, and bounces back to half of its original height after each landing; and then falls again, how many meters does it travel when it hits the ground for the 10th time? How high is the 10th rebound?

Topic 21: Monkey eating peaches: The monkey picked a number of peaches on the first day, and immediately ate half of the peaches, but he was not addicted to it, so he ate another one, and the next morning he ate half of the remaining peaches and ate more got one. After that, I ate half and one of the leftovers from the previous day every morning. On the 10th morning, when I wanted to eat again, I saw that there was only one peach left. Find out how many you picked on the first day.

Question 22: Two table tennis teams compete, each with three players. Team A consists of three people a, b, and c, and team B consists of three people, x, y, and z. The roster has been drawn to determine the competition. Someone asked the players about the roster for the game. a says he doesn't compare with x, c says he doesn't compare with x, z, please program to find out the list of three teams.

Problem 23: Print out the following pattern (diamond).

*************************

Question 24: There is a sequence of fractions: 2/1, 3/2, 5/3, 8/5, 13/8, 21/13... Find the sum of the first 20 items of this sequence.

Problem 25: Find the sum of 1+2!+3!+...+20!.

Topic 26: Use recursive method to find 5!.

Topic 27: Use the recursive function call method to print the input 5 characters in reverse order.

Question 28: There are 5 people sitting together and ask how old the fifth person is? He said that he is 2 years older than the fourth person. Asked the age of the 4th person, he said he was 2 years older than the 3rd person. Ask the third person, and he is two years older than the second person. Ask the second person and say he is two years older than the first person. Finally asked the first person, he said it was 10 years old. How old is the fifth person?

Question 29: Given a positive integer with no more than 5 digits, requirements: 1. Find the number of digits it is, and 2. Print out the digits in reverse order.

Question 30: A 5-digit number, determine whether it is a palindrome. That is, 12321 is a palindrome number, the one digit is the same as the ten thousand digit, and the ten digit is the same as the thousand digit.

0752f50441ce0eb70453c9b6b83bd1a8.png
C language

Question 31: Please input the first letter of the day of the week to judge the day of the week. If the first letter is the same, continue to judge the second letter.

Question 32: Delete a specified letter in a string, such as: the string "aca", delete the letter a in it.

Question 33: Determine whether a number is a prime number.

Topic 34: Practice function calling (call the function to output Hellow world three times).

Topic 35: String reversal, such as reversing the string "airbird" to "dribria".

Question 36: Find the prime numbers within 100.

Topic 37: Sort 10 numbers (as many ways as possible).

Problem 38: Find the sum of the diagonal elements of a 3*3 matrix.

Question 39: There is an array that is already sorted. Now enter a number and ask it to be inserted into the array according to the original law.

Question 40: Output an array in reverse order.

Topic 41: Learn how to use static to define static variables.

Topic 42: Learn to use auto to define the usage of variables.

Topic 43: Learn another way to use static.

Topic 44: Learn to use external usage.

Topic 45: Learn how to define variables using register.

Topic 46: Macro #define Command Exercise 1.

Topic 47: Macro #define Command Exercise 2.

Topic 48: Macro #define Command Exercise 3.

Topic 49: Comprehensive application of #if #ifdef and #ifndef.

Topic 50: Application exercise of #include (manipulation of multiple files).

Topic 51: Learn to use bitwise AND.

Topic 52: Learn to use bitwise OR |.

Topic 53: Learn to use bitwise XOR^.

Problem 54: Take the 4-7 digits from the right end of an integer a.

Topic 55: Learn to use bitwise negation~.

Topic 56: Drawing, learn to draw circles with circles.

Topic 57: Drawing, learn to use line to draw straight lines (implemented in TC).

Topic 58: Learn to draw squares with rectangles. (implemented in TC).

Topic 59: Drawing, Comprehensive Example 1. (implemented in TC).

Topic 60: Drawing, Comprehensive Example 2. (implemented in TC).

Topic 61: Print out the Yanghui triangle (requires 10 lines to be printed).

Topic 62: Learning putpixel to draw points, (implemented in TC).

Topic 63: Draw an ellipse (implemented in TC).

Topic 64: Drawing with ellipse and rectangle (implemented in TC).

3bcbf4f4b6b799ac85aafe1c80d976bd.gif
C language

Topic 65: A most elegant pattern (implemented in TC).

Question 66: Input 3 numbers a, b, c and output them in order of magnitude.

Question 67: Input an array, swap the largest with the first element, and swap the smallest with the last element, and output an array.

Problem 68: There are n integers, so that the preceding numbers are moved back m positions in order, and the last m numbers become the first m numbers.

Question 69: There are n people in a circle, and they are numbered in order. Start counting from the first person (counting from 1 to 3), and those who report to 3 leave the circle and ask who is the original number at the end.

Topic 70: Write a function to find the length of a string, input the string in the main function, and output its length.

Topic 71: Write the input() and output() functions to input and output the data records of 5 students

Topic 72: Create a linked list.

Topic 73: Reverse output a linked list.

Topic 74: Joining two linked lists.

Topic 75: Master the ASCII codes corresponding to the upper and lower case of the 26 English letters.

Topic 76: Write a function that calls the function to find 1/2+1/4+...+1/n when the input n is an even number, and calls the function 1/1+1/3+ when the input n is an odd number. ..+1/n (using pointer functions).

Topic 77: Fill-in-the-blank exercise: #include<stdio.h>

#include<stdlib.h>int main(){char *s[]={"man","woman","girl","boy","sister"};char **q;int k;for(k=0;k<5;k++){这里应该填入________printf("%sn",*q);}return 0;}

Question 78: Use the structure to find the oldest person and output. Please find out what's wrong with the program. (person[3]={"li",18,"wang",19,"sun",22};)

Topic 79: Enter strings and sort.

Question 80: There are a bunch of peaches on the beach, and five monkeys will divide them. The first monkey divided the pile of peaches into five equal parts, one more, the monkey threw the more one into the sea and took one. The second monkey divided the remaining peaches into five equal parts, and added one more. It also threw the extra peaches into the sea and took one part. The third, fourth, and fifth monkeys did the same. Yes, how many peaches were there originally on the beach?

Question 81: 809*??=800*??+9*??+1 where ?? represents two digits, the result of 8*?? is two digits, and the result of 9*?? is three digits. Find the two digits represented by ?? and the result after 809*??.

Topic 82: Convert Octal to Decimal

Question 83: Find the odd numbers that can be formed from 0 to 7.

Problem 84: An even number can always be expressed as the sum of two prime numbers. Input an even number, output the two prime numbers.

Question 85: Determine if a prime number is divisible by several 9s.

Topic 86: Two string concatenation programs.

Question 87: Answer the result (structure variable transfer).

#include<stdio.h>struct student{int x;char c;} a;int main(){a.x=3;a.c='a';f(a);printf("%d,%c",a.x,a.c);}f(struct student b){b.x=20;b.c='y';}

Topic 88: Read the integer value of 7 numbers (1-50), each time a value is read, the program prints the * of the number of the value.

Topic 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: add 5 to each digit, and then replace the number with the remainder after dividing the sum by 10. , then swap the first and fourth bits, and the second and third bits.

Question 90: Read the results. #include<stdio.h>

#include<stdlib.h>#define M 5int main(){int a[M]={1,2,3,4,5};int i,j,t;i=0;j=M-1;while(i<j){t=*(a+i);*(a+i)=*(a+j);*(a+j)=t;i++;j--;}for(i=0;i<M;i++) {printf("%dn",*(a+i));}}

Topic 91: Example of time function 1

Topic 92: Example of time function 2

Topic 93: Example of time function 3

Topic 94: Design a guessing game.

Topic 95: Simple struct application example.

Topic 96: Count the number of occurrences of a substring in a string.

Question 97: Enter some characters from the keyboard and send them to disk one by one until a # is entered.

Question 98: Input a string from the keyboard, convert all lowercase letters to uppercase letters, and then output to a disk file "test" to save. The input string ends with !.

Question 99: There are two disk files A and B, each containing a line of letters, and the information in these two files is required to be merged (in alphabetical order) and output to a new file C.

Item 100: There are five students, and each student has 3 courses. Input the above data (including student number, name, and 3 course scores) from the keyboard, and calculate the average score, considering the original data and calculated results. The average score is stored in the disk file "stud".

Although there seem to be many questions, they are all relatively simple basic questions in the C language. Be sure to calm down and write slowly!

7f0bf24dcf41f656e582d9ab2a69f946.png
C language

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=324069727&siteId=291194637