update 2024/11/15

This commit is contained in:
Dengrb 2024-11-15 22:53:19 +08:00
parent d3483cf241
commit d2b0ed7908
4 changed files with 42 additions and 0 deletions

42
homework_laster.cpp Normal file
View File

@ -0,0 +1,42 @@
/*某邮局对邮寄包裹有如下规定:若包裹的重量超过30千克则不予邮寄对可以邮寄的包裹每件收取手续费0.2元,再加上根据以下收费标准计算的结果。收费标准(元/千克)
()
<=100.8010<<=200.750.7
20<<=30
Fail*/
#include<iostream>
#include<windows.h>
#include<iomanip>
using namespace std;
int main(){
float CIN,money;
cin >>CIN;
if (CIN <= 10)
{
money = CIN * 0.80 + 0.20;
cout <<fixed<<setprecision(2)<<money;
Sleep(2000);
return 0;
}else if (CIN > 10 and CIN <= 20)
{
money = CIN * 0.75 + 0.20;
cout <<fixed<<setprecision(2)<<money;
Sleep(2000);
return 0;
}else if (CIN > 20 and CIN <=30)
{
money = CIN * 0.7 + 0.20;
cout <<fixed<<setprecision(2)<<money;
Sleep(2000);
return 0;
}else
{
cout <<"Fail!";
Sleep(2000);
return 1;
}
return 0;
}

BIN
homework_laster.exe Normal file

Binary file not shown.