pay.cpp
来自「c语言教程源码」· C++ 代码 · 共 19 行
CPP
19 行
#include <iostream.h>
float hours_worked, pay_rate, week_pay;
void main()
{
cout << "enter the hours worked: ";
cin >> hours_worked;
cout << endl << "enter the pay rate: ";
cin >> pay_rate;
cout << endl<< endl;
if (hours_worked <= 40)
week_pay = hours_worked * pay_rate;
else
week_pay = 40 * pay_rate + (hours_worked - 40) * 1.5 * pay_rate;
cout << "The weekly pay is " << week_pay << endl;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?