#11350: C++清晰正解


TzuchunChen (陳子濬)

學校 : 國立嘉義高級中學
編號 : 59216
來源 : [49.215.236.123]
最後登入時間 :
2019-05-06 08:46:33
a003. 兩光法師占卜術 | From: [27.105.24.181] | 發表日期 : 2016-09-11 11:41

#include <iostream>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
 
 int M, D, S;
 
 while (cin >> M >> D )
 {
 S=(M*2+D)%3 ;
 
 if(S==0)
 {cout << "普通" << endl;}
 
 else if(S==1)
 {cout << "吉" << endl;}
 
 else if(S==2)
 {cout << "大吉" << endl;}
 
 }
 return 0;
}

 
ZeroJudge Forum