| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
求您帮帮忙,我真的发现不了错误!重谢!!#include <iostream.h>
long n,m;
void deal(long a,long b)
{
long s=a/8;
int r=a%8;
if(a==0&&b==0)
cout<<0<<endl;
else if(a==b||a==0)
cout<<1<<endl;
else if(r==2||r==5||r==7)
cout<<1<<endl;
else if(r==0)
{
if(b==s*5+a)
cout<<0<<endl;
else
cout<<1<<endl;
}
else
{
switch(r)
{
case 1:
{
if(b==a+1+5*s)
cout<<0<<endl;
else
cout<<1<<endl;
}break;
case 3:
{
if(b==a+2+5*s)
cout<<0<<endl;
else
cout<<1<<endl;
}break;
case 4:
{
if(b==a+3+5*s)
cout<<0<<endl;
else
cout<<1<<endl;
}break;
case 6:
{
if(b==a+4+5*s)
cout<<0<<endl;
else
cout<<1<<endl;
}break;
default:break;
}
}
}
void main()
{
long temp;
while(cin)
{
cin>>n>>m;
if(n>m)
{
temp=m;
m=n;
n=temp;
}
deal(n,m);
}
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator