#8394: 請求幫忙,我只有"吉"


frogledd887 (frogledd)

學校 : 國立屏東科技大學
編號 : 35845
來源 : [49.158.76.211]
最後登入時間 :
2021-07-16 07:33:39
a003. 兩光法師占卜術 | From: [1.174.210.89] | 發表日期 : 2013-11-23 17:38

程式新手,為甚麼只有吉?? 
 
 
#include <cstdlib>
#include <iostream>
#include<stdio.h>
using namespace std;

int main(int argc, char *argv[])
{
    int m=0,d=0,s;
    
    
    while(cin>>m&&cin>>d)
    //cin>>m;
    //cin>>d;
     {
     s=(m*2+d)%3;
     if(s=0)
            cout<<"普通"<<endl;
     else if(s=1)
          cout<<"吉"<<endl;
     else
         cout<<"大吉"<<endl;
     }
    system("PAUSE");     
    //return 0;
}

 
#8430: Re:請求幫忙,我只有


yp155136 (Yuuki~~~)

學校 : 臺北市私立延平高級中學
編號 : 27906
來源 : [118.233.148.181]
最後登入時間 :
2022-11-26 14:35:49
a003. 兩光法師占卜術 | From: [220.229.26.102] | 發表日期 : 2013-12-05 22:25

程式新手,為甚麼只有吉?? 
 
 
#include
#include
#include
using namespace std;

int main(int argc, char *argv[])
{
    int m=0,d=0,s;
    
    
    while(cin>>m&&cin>>d)
    //cin>>m;
    //cin>>d;
     {
     s=(m*2+d)%3;
     if(s==0)
            cout<<"普通"<
     else if(s==1)
          cout<<"吉"<
     else
         cout<<"大吉"<
     }
    system("PAUSE");     
    //return 0;
}

一個=是指定
例:int sum=2;
兩個=是相等 
 
 
ZeroJudge Forum