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> using namespace std; int main() { unsigned int s, d; while(cin>>s>>d) { if (d > 4*s && d < 5*s) { cout<<10*s - 2*d<<endl; } else if (2*d > 3*s && 2*d < 4*s) { cout<<8*s - 4*d<<endl; } else if (3*d > 2*s && 3*d < 3*s) { cout<<6*s - 6*d<<endl; } else if (12*d > 3*s && 12*d < 4*s) { cout<<3*s - 9*s<<endl; } else { cout<<"Deficit"<<endl; } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator