- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main() {
- int mins;
- cout<<"請輸入幾分鐘 ";
- cin>>mins;
- cout<<endl<<"可以換算成"<<endl<<endl;
- if(mins>=60*24){
- cout<<mins/(60*24)<<"天,"<<endl;
- mins%=(60*24);
- }
- if(mins>=60){
- cout<<mins/60<<"小時,"<<endl;
- mins%=60;
- }
- if(mins>=1){
- cout<<mins/1<<"分鐘"<<endl;
- }
- cout<<endl;
- system("pause");
- return 0;
- }
複製代碼 |