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

AcWing 669. 加薪 更多...

#include <acwing.h>

静态 Public 成员函数

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

详细描述

AcWing 669. 加薪

在文件 acwing.h462 行定义.

成员函数说明

◆ main()

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

在文件 acwing.cpp1263 行定义.

1263 {
1264 double salary;
1265 cin >> salary;
1266 unsigned short percentual = 0;
1267 if(salary <= 400) {
1268 percentual = 15;
1269 } else if(salary <= 800) {
1270 percentual = 12;
1271 } else if(salary <= 1200) {
1272 percentual = 10;
1273 } else if(salary <= 2000) {
1274 percentual = 7;
1275 } else {
1276 percentual = 4;
1277 }
1278 const double new_salary = salary * (100 + percentual) / 100;
1279 cout << setiosflags(ios::fixed) << setprecision(2);
1280 cout << "Novo salario: " << new_salary << endl;
1281 cout << "Reajuste ganho: " << new_salary - salary << endl;
1282 cout << "Em percentual: " << percentual << " %";
1283 return 0;
1284 }

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


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