Peking University Jade Bird requirements: In recommending employment, according to the following criteria to measure
1) : If the number of projects is less than 5, employment cannot be recommended
2) : The number of projects is less than 6 to 10: only small companies in Chongqing can be recommended
3) : The number of projects is less than 11 to 20: any company in Chongqing can be recommended
4) : The number of projects is more than 20: may enter foreign companies
The code is as follows:
#include <stdio.h>
int main(a)
{
int a;
printf("\n Please enter the number of your projects :");
scanf("%d",&a);
if(a<=5)
{
printf("Right not please, you cannot recommend obtain employment!!");
}
else if(a>=6 && a<=10)
{
printf("Can only recommend to chongqing small company!!");
}
else if(a>=11 && a<=20)
{
printf("Congratulations!! You can choose chongqing so there are companies.");
}
else if(a>=20)
{
printf("Wow!!!!! You can join a foreign enterprise.");
}
else
{
printf("输入错误!!"); }}Copy the code
The output running window is as follows:
Other exercises this week
C programming column
① Write an input function to receive n integers from the keyboard and store them in an array of integers. Call this function in the main function to compute the sum of the n integers.
② The user enters a set of data until a return is entered and the data is put into an array. Requirements: first bubble sort array, output results; Then prompt the user “whether to insert data”, if you want to insert data, insert the inserted data into the array, and still output in order; And then you get the maximum and the minimum, and you output.
③ In the postal system, the charge is so stipulated, when the parcel weight <=10 kg, according to the charge of 0.25 yuan per kg; If more than 10 kg, the excess part will be charged 0.34 yuan, the rest will be charged 0.25 yuan. The user is requested to input the weight of the parcel, please output the postage payable.
The sixth week ④ party provisions: boys, more than 18 years old can drink, no more than 18 years old, drink; Girls, over 20 years old, can drink alcohol, not over 20 years old, drink drinks; Please input student gender and student age, and according to the input to judge what to drink!
Beijing University Jade bird requirements: in the recommendation of employment, according to the following criteria to measure
1) : If the number of projects is less than 5, employment cannot be recommended
2) : The number of projects is less than 6 to 10: only small companies in Chongqing can be recommended
3) : The number of projects is less than 11 to 20: any company in Chongqing can be recommended
4) : The number of projects is more than 20: may enter foreign companies
C programming > sixth week ⑥ Input a string of characters, statistics write letters, and emphasize that statistics must use functions.
Write a program to create a structure called BOOK that stores information about the BOOK: title, author’s name, page number, and price, and accepts input and output.
C language programming > the sixth week ⑧ write procedures to achieve magic square matrix.
The harder you work, the luckier you get! Come on, Aoli!!