#12016: C(解)


asd11020313 (unknown)

學校 : 國立聯合大學
編號 : 66183
來源 : [42.73.22.212]
最後登入時間 :
2017-05-16 12:29:43
a003. 兩光法師占卜術 | From: [61.223.182.75] | 發表日期 : 2017-05-11 22:58

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
int month,day,S;


while(scanf("%d %d", &month, &day)!=EOF)
{
/* if(month<0 || month>2)
{
printf("ERROR");
break;
}
if(day<0 || day>2)
{
printf("ERROR");
break;
} */

S=(month*2+day)%3;



if(S==0)
{

printf("普通\n");
}
else if(S==1)
{

printf("吉\n");
}
else if(S==2)
{

printf("大吉\n");
}

}
return 0;
}

 
ZeroJudge Forum