problemscpp
A collection of my answers to algorithm problems in c++.
静态 Public 成员函数 | 所有成员列表
acwing::acwing672类 参考

AcWing 672. 税 更多...

#include <acwing.h>

静态 Public 成员函数

static int main (istream &cin, ostream &cout)
 

详细描述

AcWing 672. 税

在文件 acwing.h468 行定义.

成员函数说明

◆ main()

int acwing::acwing672::main ( istream &  cin,
ostream &  cout 
)
static

在文件 acwing.cpp1286 行定义.

1286 {
1287 double income;
1288 cin >> income;
1289 double tax = 0;
1290 if(income <= 2000) {
1291 tax = 0;
1292 } else if(2000 < income && income <= 3000) {
1293 income -= 2000;
1294 tax += income * 0.08;
1295 } else if(income <= 4500) {
1296 tax = 80;
1297 income -= 3000;
1298 tax += income * 0.18;
1299 } else {
1300 tax = 350;
1301 income -= 4500;
1302 tax += income * 0.28;
1303 }
1304 if(tax == 0) {
1305 cout << "Isento";
1306 } else {
1307 cout << setiosflags(ios::fixed) << setprecision(2) << "R$ " << tax;
1308 }
1309 return 0;
1310 }

被这些函数引用 acwing::TEST().


该类的文档由以下文件生成: