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:贴个简单代码 Posted by:GreatAccepted at 2010-01-25 16:54:07 #include<stdio.h> #include<stdlib.h> int main() { int s, d, re; while(scanf("%d%d",&s, &d)==2) { if(4*s-d<0) re=10*s-2*d; else if(3*s-2*d<0) re=8*s-4*d; else if(2*s-3*d<0) re=6*s-6*d; else if(s-4*d<0) re=3*s-9*d; else re=-1; if(re<0) printf("Deficit\n"); else printf("%d\n", re); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator