Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:貌似您的分类跟我不太一样,应该不需要这么复杂。。。

Posted by schnee at 2010-07-20 10:31:19 on Problem 2586
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator