#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;
}