- #include<iostream>
- #include<cstdlib>
- #include<string>
- using namespace std;
- int main()
- {
- int money, hr;
- cout<<"請輸入總額: ";
- cin>>money;
- if(money<=100)
- cout<<"你停了"<<money/30<<"小時"<<endl;
- else if(money>100 && money<320)
- cout<<"你停了"<<money/50<<"小時"<<endl;
- else if(money>=320 && money<600)
- cout<<"你停了"<<money/80<<"小時"<<endl;
- else
- cout<<"你停了"<<money/100<<"小時"<<endl;
- system("pause");
- return 0;
- }
複製代碼 |