#include <iostream>
using namespace std;
int main()
{
int R=40,sum,h;
cout<<"请输入每周工作的时间h= ";
cin>>h;
if(h<=40)sum=h*R;
else sum=40*40+(h-40)*1.5*R;
cout<<"你的周工资为:"<<sum<<endl;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int R=40,sum,h;
cout<<"请输入每周工作的时间h= ";
cin>>h;
if(h<=40)sum=h*R;
else sum=40*40+(h-40)*1.5*R;
cout<<"你的周工资为:"<<sum<<endl;
return 0;
}