返回列表 發帖
#include<iostream>
#include<cstdlib>
using namespace std;
int main(){
int ans;
re:
cout<<"請問你上週運動幾天?"<<endl;

cin>>ans;
switch(ans)
{


case 0 ... 2:
    cout<<"有點少...加油!"<<endl;
    break;
case 3 ... 4:
    cout<<"還不錯,繼續努力!"<<endl;
    break;
case 5 ... 7:
    cout<<"健康寶寶代言人"<<endl;
    break;

default:
    cout<<"你不知道一週有幾天嗎?"<<endl;
    break;

}
goto re;

system("pause");
return 0;
}

TOP

返回列表