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 |
wa了N次了...为什么呢.....#include <cstdio> int max; int main() { int s,d; while(scanf("%d%d",&s,&d)!=-1) { max=-1; d=-d; if (4*s+d<0) max=10*s+2*d; else if(3*s+2*d<0) max=4*d+8*s; else if(2*s+3*d<0) max=6*(d+s); else if(s+4*d<0) max=8*d+4*s; if (max<0) printf("Dificit\n"); else printf("%d\n",max); } return 0; } /* Dificit为<=0的情况也试过了,一直WA, 无语了,谁能告诉我错在哪儿呢.... */ Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator