hdu1085

View Code
1 #include"iostream"
2 using namespace std;
3 int main()
4 {
5 int a,b,c;
6 int sum;
7 while(cin>>a>>b>>c,a+b+c)
8 {
9 if(a==0) sum=1;
10 if(b==0&&a)
11 {
12 if(c==0) sum=a+1;
13 else if(c)
14 {
15 if(a<4) sum=a+1;
16 else sum=a+5*c+1;
17 }
18 }
19 if(a*b&&c==0) sum=a+2*b+1;
20 if(c*a*b)
21 {
22 if(a+2*b<4) sum=a+2*b+1;
23 else
24 sum=a+2*b+5*c+1;
25 }
26
27 cout<<sum<<endl;
28 }
29 return 0;
30 }
posted @ 2011-03-23 10:02  聊聊IT那些事  阅读(285)  评论(0编辑  收藏  举报