1、C#基础练习题Data type practice problemsWrite the characters for unicode encoding 0x7EF0 and 0x8F9E respectivelyOutput 2.5423 and two decimal formatsWrite 23 and -76 original and complementOperator and expression practice problems1 let the user type in the length and width of the rectangle, then show the
2、circumference of the rectangle2. Int x is 6, y is 6, p, q; Write the following statement, the value of x, y, and q(1) p is equal to x + + + + x + +.(2)3. Use an int variable said a person a month attendance, allow the user to input the value of the variable, and then prompt the user for 1 31 one num
3、ber, to judge whether the persons attendance on the day.Conditional statement exercisesTake a number and determine whether this number is a prime number (prime number, also known as a prime number: the number that can only be divisible by 1 and itself, 2 is the smallest prime number)Take two integer
4、s, compare the size, and print out the large Numbers.To receive two integers and a symbol (+ - * / %), which corresponds to two integers based on the symbol.Divide your grades into four grades:90-100 - A level70-89 - B level60-69 - C gradeBelow 60 DReceive the students grade and get the grade of the
5、 participantTake three and print out the maximumReceive three Numbers and rank them from small to largeDetermine if a number can be divisible by 3 and 5The price of a ticket will vary according to the shipping space and the month of the trip. As in the peak season 5 - October: first class price is 1
6、0% off the original price; Economy class is 75 percent of the original price. Other off-season travel: first class prices are 60% off the original price; Economy class is a 30% discount for the original price.Depending on the month of the trip and the type of cabin you choose, calculate the correspo
7、nding fares (if and switch, respectively)The principal is calculated according to the principal and the interest rate of the period. Interest rates are as follows:1 year 2.25%2 years of 2.7%Three years of 3.24%Five years 3.6%Define the variable to hold the principal and interest rates, and calculate
8、 the total amount of interest in maturity.Enter a number from the screen to determine if it is “daffodils“.The so-called “daffodil number“ means a three-digit number, its digital cube and the number itself. For example: 153 is a “daffodil number“ because 153 = 13 + 53 + 33Use the switch implementati
9、on: enter a date to determine whether it belongs to early, middle or lateThe bonuses paid by the enterprise are made up of profits. When the profit (I) is below or equal to 10,000 yuan, the bonus shall be 10%. The profit is above 10,000 yuan, less than 20,000 yuan, less than 10,000 yuan is 10% commi
10、ssion, more than 10,000 yuan, can raise 7.5%; Between 20,000 and 40,000 yuan, more than 20,000 yuan, can be made up of 5%. Between 40,000 and 60,000 yuan, which is more than 40,000 yuan, can be made up of 3%. Between 60000 and 100000, more than 60000 yuan, can be cut by 1.5%, higher than 100000 yuan
11、, more than 100000 yuan of 1% commission, from the keyboard input profit during the month, I should ask total bonuses?13. The supermarket cashier system regulation, to spend 500 yuan can play 9.8 fold, spend 800 yuan can play 9.5 fold, spend 1000 yuan can 9 discount, first ask for consumption amount
12、, according to accounts receivable amount and discount amount“You are charged * * * yuan to save * * yuan.“Write a program, enter New Year and month.(1) to determine whether the year is a leap year(2) what is the season according to the given monthHow many days are there in the month?Write a program
13、 that determines if a, b, and c values are entered by the user. Can you make a triangle?Determine whether 12321 is an echo (the single digit is equal to the tens of thousands, and the tens and thousands are equal)Practice questions for the circular statement1 let the user enter a number to determine
14、 the number of digitsPrint out a positive integer that can be divided by 3 integers in 1, 000. Each line shows 10 NumbersCalculate the sum of all integers that are divisible by 7 within 100The loop receives N integers until the user enters 0. Print out the maximum number and the smallest number in t
15、hese Numbers.The score must be between 0 and 100, and if it is not satisfied, the user will be prompted to enter until the correct score is entered.Accept 10 Numbers, calculate the sum of the positive integers, if the user input 999 is over.To receive a number, the output is the result of multiplica
16、tion by 1 to 10Find the ones between 1 and 100 not 2, 3, 4, 7, and they cant be combined with the integers of 3 integersWhen logging into QQ, the QQ number and password must be correct and the password will be able to login successfully. Lets say that you only allow the user to type in three times,
17、and the middle one is correct, and the message is: login is successful. If the first information is incorrect, the prompt is given: the QQ number or password is incorrect.Please re-enter, and you have two more chances. The second time is incorrect, give: the QQ number or password enter wrong, please
18、 enter again, you still have 1 second chance. The third time, if the input is incorrect, give a hint: you are wrong in three times, please contact the administrator.The principal 10,000 yuan is deposited in the bank, and the annual interest rate is three thousandths. Each year, the principal and int
19、erest are added as the new principal. What is the principal that you get in 5 years?Write a game level rating and loop through each inning (10 innings) to show the level of the game. Criteria for scoring: if 90% of the 10 games are above 80, if 60% is above 80, the rest is level 3.Accept a number wi
20、thin 10 and count the factorial of this number. Such as 5! = 1 * 2 * 3 * 4 * 5Print patternsone12123123412345* * * * * * * * * * * * * * * * * * *1234234134124123* * * * * * * * * *Receive an integer (1-26) and print the figure between a-z. If you receive 26, you print the following figure(char) 65
21、- - A (char) 66 - - BAnd so ona.BBBCCCCCDDDDDDDEEEEEEEEEFFFFFFFFFFFGGGGGGGGGGGGGHHHHHHHHHHHHHHHIIIIIIIIIIIIIIIIIJJJJJJJJJJJJJJJJJJJKKKKKKKKKKKKKKKKKKKKKLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPQQQQQQQQQQQQQ
22、QQQQQQQQQQQQQQQQQQQQRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
23、XXXXXXXYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZDivide your grades into four grades:90-100 - A level70-89 - B level60-69 - C gradeMore than 60 DTo receive five students grades, determine which class the participant should belong toThe keyboa
24、rd enters an integer (between 0-9) and displays the following graph (n = 5)12345123412312oneThe keyboard enters an integer (between 0-9) and displays the following graph (n = 5)123452345345455The double loop passes the following figures (5 in the console)* * * * *Draw the following figures: 1. For *
25、 (an odd number from the console)1 *234 * * *12345 * * *Enter an odd number to display the following schema (e.g. num = 5)* * * * * * * * * * * * *The keyboard inputs the number 1-9, displaying the following character graphics (N = 5)9, 8, 7, 6, 510 21 19 20 411 22 18 March 2512 and 24 17 213 14 15
26、16 19 10 11 12 58 19 20 21 4July 18 25 22 324 23 2 June 175, 4, 3, 2, 117 18 19 20 2116, 5, 6, 7, 2215, 4, 1, 8, 2314, 3, 2, 9, 2411 12 13 10 to 2513 14 15 16 112 and 24 17 211 22 18 March 2510 21 19 20 49, 8, 7, 6, 55, 6, 7, 8, 94 19 20 21 103 18 22 November 252 17 and 24 and 121 13 14 15 16Print o
27、ut the multiplication tableTake the prime of 100Ask for the number of daffodils between 1000. The daffodil number is the three-digit number, and the number of its members is the same as the number itself. For example: 371 = 3 * 3 * 3 + 7 * 7 + 1 * 1 * 1The Fibonacci sequence: 1, 1, 2, 3, 5, 8, 13. T
28、he value of 50 itemsEnter an integer n to determine if it is the completion number (a number exactly the sum of its factors, called the number)The calculated PI = 4/1-4/3 + 4/5-4/7.Enter the first number, such as 3, and enter the second digit, such as 4, 3 + 33 + 333 + 3333 with 2 for implementation
29、sExport the leap years between 1900 and this year, and count the NumbersMonkeys eat peach problems: the first day the monkey takes off N peaches, he eats half of them and eats another one. The next day he ate half of the remaining peaches and ate one more. We will eat more than half the day before.
30、On the seventh day, when you want to eat again, you will have a peach. How many peaches will be taken in the first day?The input n, the calculation is 1/1-1/2 + 1/3-1/4 + 1/5-1/6. 1 / nEnter two Numbers of m and n, each of which outputs the maximum common and the least common multiple of these two N
31、umbers31. A ball from a free fall 100 m height, half of the height to bounce back after each fall to the ground, down again, again rebound, seeks after the 10th floor, a total of how many meters? How high is the 10th bounce? 100/2 nHow many Sundays are there in the year to this day33. The bus ticket
32、ing system, each after a station, after a number of station (station), add 1 votes (tickets) minus 1, until there is no ticket, prompt “tickets has been used up, totally take x stand, please get off“. Use the while loop to implement the above programWe have 2 over 1 plus 3/2 plus 5/3 plus 8/5 plus 1
33、3/8. The first 20 sum?35. One hundred yuan to buy chicken, with one hundred yuan can be used to buy chicken, known the cock 5 yuan each, three yuan each, hen chicks three only one yuan, asked to use the one hundred yuan to buy one hundred chickens The rooster hen chicks each have how many, list all
34、qualified.An array of exercisesDefine a two-dimensional array of 20 * 3, which is used to store the results of a class of 20 students in a class of 20. These three subjectsIn the order of storage: c # foundation, Winform, Asp.Net.(1) a random integer between 0 and 100 for each element of a two-dimen
35、sional array.(2) the results of each course of the course are output according to the list.(3) the program is required to evaluate the total score of each participant, leaving it in another one-dimensional array.(4) the program is required to write the average score of a course for all students.Outp
36、ut an array in reverse orderProblem: input an array, the largest exchange with the first element, the smallest exchange of the last element, the output array.Find the number of odd Numbers and even Numbers in a four-by-five rectangle arrayDefine a two-dimensional array of rows and columns, and initi
37、alize them to find the sum of the two diagonal linesCount the number of English words in an English sentence, separated by Spaces between words.There are n people in a circle, starting from the first person (from 1 to 3), the person who reports 3 is out of the circle, and the last is the number of t
38、he originalTo separate the words between the words in an English sentence. Such as: how old are youYou are old howRearrange a lowercase English string and place all the same characters in the order in which the characters appear. Acbabca is lined up:aaaccbbType 12 data for the whole two-dimensional
39、array b 3 4, calculate and output the sum of all the positive Numbers in the array, the sum of all the negative Numbers.11. Young singers song grand prix, with 10 judges scores, try programming for the average scores of the player (remove the a and a minimum points).12. A two dimensional array b 5 4
40、 of saddle points, namely b I j element values in the line of the youngest, I and the largest in the first column j, try to write a program to find all the saddle point, and the output values underneath. Maybe not.There is an electric message which has been translated as follows:A - Z - A - ZB to B Y, YC - C X - X. .The first letter becomes the 26th letter, and the ith letter becomes the first (26-i + 1). Non-alphanumeric invariant. Write a program that translates the password into the original and prints the password and the original.