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 |
Re:我的怎么错了 有什么特殊的地方?In Reply To:Re:我的怎么错了 有什么特殊的地方? Posted by:sunwen at 2007-09-23 15:53:47 #include<iostream> using namespace std; int A,a,B,b,P; int main() { cin>>A>>a>>B>>b>>P; if((B<=a&&A<=P)||(A<=b&&B<=P)||A+B<=P) cout<<"Yes"<<endl; else cout<<"No"<<endl; return 0; }就可以了 > #include<stdio.h> > int main() > { > int A,B,a,b,P,flag1,flag2; > while(scanf("%d%d%d%d%d",&A,&a,&B,&b,&P)!=EOF) > { > if(a<=0||P<=0||A<=0||B<=0||b<=0) > { > printf("No\n"); > return 0; > } > if(a>=A||b>=B) > { > printf("No\n"); > return 0; > } > if(A>P||B>P) > { > printf("No\n"); > return 0; > } > if(A>B) > { > flag1=2*(P-A); > flag2=2*(A-a); > if(flag1>=2*B||flag2>=2*B) > printf("Yes\n"); > else > printf("No\n"); > } > else > { > flag1=2*(P-B); > flag2=2*(B-b); > if(flag1>=2*A||flag2>=2*A) > printf("Yes\n"); > else > printf("No\n"); > } > } > return 0; > } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator