返回列表 發帖
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
re:
    int x;
    cout<<"請問你上周共運動幾天呢?";
    cin>>x;
    switch(x)
    {
        case 0 ... 2:
            cout<<"有點少...加油!"<<endl;
            break;
        case 3 ... 4:
            cout<<"還不錯,繼續努力!"<<endl;
            break;
        case 5 ... 7:
            cout<<"健康寶寶代言人"<<endl;
            break;
        default:
            cout<<"你不知道一週有幾天嗎?"<<endl;
    }
    cout<<endl;
    goto re;
    system("pause");
    return 0;
}

TOP

返回列表