返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. using namespace std;
  4. int main(){
  5.     int x;
  6.     re:
  7. cout<<"請輸入你想換算的分鐘數";
  8. cin>>x;
  9. cout<<"也可換算為";
  10. if(x<=0)
  11.     goto re;
  12. if(x>=1240){
  13. cout<<x/1240<<"天"<<endl;
  14. x%=1240;}
  15. if(x>=60&&x<1240){
  16. cout<<x/60<<"小時"<<endl;
  17. }
  18. if(x>=1&&x<60)
  19.     cout<<x<<"分鐘"<<endl;



  20. goto re;
  21. system("pause");
  22. return 0;

  23. }
複製代碼

TOP

返回列表