#8569: 請問哪裡錯誤?


ron19971997 (Ron Lee)


#include<iostream>
using namespace std;
int main()
{
    int M,D,S;
    S=(M*2+D)%3;
    while(cin>> M>> D)
    {
    cout<<S<<endl;
    if(S==0)
    cout<<"\n普通";
    else if(S==1)
    cout<<"\n吉";
    else(S==2);
    cout<<"\n大吉";
    }
    system("pause");
    return 0;
}

#8573: Re:請問哪裡錯誤?


dibery (Bor)


Calculate S in the loop.

Don't print S as it's not required by the statement.

Also, don't use system( "pause" ) when submitting here.