#10394: c++ switch解答


sujohn3 (unknown)

學校 : 不指定學校
編號 : 53249
來源 : [36.231.205.120]
最後登入時間 :
2015-10-31 01:49:18
a003. 兩光法師占卜術 | From: [36.231.205.120] | 發表日期 : 2015-10-27 18:32

#include <iostream>

using namespace std;

int main(){

 int M,D,S;

M=0;D=0;S=0;

 

    while (cin >>M >>D ){

   

          S=(M*2+D)%3;

          cout <<S;

       

       switch(S){

case 0:

cout << "普通"<<endl;

break;

case 1:

cout << "吉"<<endl;

break;

case 2:

cout << "大吉"<<endl;

 

    

          }

    }

return 0;

}

 
ZeroJudge Forum