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


frogledd887 (frogledd)


程式新手,為甚麼只有吉?? 
 
 
#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~~~)


程式新手,為甚麼只有吉?? 
 
 
#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;
兩個=是相等