#7548: 有哪裡出錯呢?(c++)


s1011220 (林柏翰)


#include<cstring>
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    cout<<n;
    
     if(n%3==0)
    {
        cout<<"yes"<<endl;
    }
    else
    {
        cout<<"no"<<endl;
    }
  
    return 0;
}

 

 

#9372: Re:有哪裡出錯呢?(c++)


emmaliu (人)


#include
#include
#include
using namespace std;
int main()
{
    int n;
    cin>>n;
    cout<    
     if(n%3==0)
    {
        cout<<"yes"<    }
    else
    {
        cout<<"no"<    }
  
    return 0;
}

       
我也錯ㄟ為甚麼
#9373: Re:有哪裡出錯呢?(c++)


anandrewboy70900 (ShowTsai)


他的輸入會超過int的範圍喔

所以要用字串去寫