Home > Back-end >  Don't know much about this C language
Don't know much about this C language

Time:12-10

Between the two freight problem:
Freight are air, sea and land three,
Freight will be in the air: 20 kg is 100 yuan, since every 10 kg will increase in 30 yuan, 50 kilos caps (i.e. weight greater than 50 kilos shall pay) on the basis of the price of 50 kg.
Road transport: freight shall be within 30 kg is 50 yuan, 15 yuan per more than 20 kg will increase since then, 100 kilograms of cap (i.e. weight greater than 100 kg will be paid for the price of 100 kg);
Shipping: within 30 kg freight all is 30 yuan, since each 5 yuan, 10 kg will increase in 50 kilos caps (i.e. weight greater than 50 kilos shall pay) on the basis of the price of 50 kg,

Please write a program that requires: input cargo shipping and cargo weight, calculate the freight prices, requirements in the program at the same time use the if and switch statements,
Note: subject to use select statements nested,

CodePudding user response:

This topic is not difficult, as a condition of the switch, the three kinds of freight way used in each case statement if elseif else can determine different focus of the freight, is also a small white one, I say no more inclusion
  • Related