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:请帮忙看一下我的程序为什么WAIn Reply To:请帮忙看一下我的程序为什么WA Posted by:trymj at 2006-03-24 18:25:05 #include<stdio.h> int main() { long i,max,s,d; while(scanf("%ld%ld",&s,&d)==2) { if(4*s-d<0) { max=2*(5*s-d); if(max<0) printf("Deficit\n"); else printf("%ld\n",max); goto l; } if(3*s-2*d<0) { max=4*(2*s-d); if(max<0) printf("Deficit\n"); else printf("%ld\n",max); goto l; } if(2*s-3*d<0) { max=6*(s-d); if(max<0) printf("Deficit\n"); else printf("%ld\n",max); goto l; } if(s-4*d<0) { max=3*(s-3*d); if(max<0) printf("Deficit\n"); else printf("%ld\n",max); goto l; } printf("Deficit\n"); l:; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator