标签:type bin 提交 div main c语言 style res scanf
1 #include<stdio.h> 2 int main(){ 3 int a,b,c,d; 4 int sum1=0,sum2=0,sum3=0,sum4=0,sum5=0;//没种菜数量初值赋0 5 scanf("%d\n%d\n%d\n%d",&a,&b,&c,&d); 6 if(a-2>=0 && b-1>=0 && d-2>=0){ 7 a = a-2; 8 b = b-1; 9 d = d-2; 10 sum1++; 11 } 12 if(a-1>=0 && b-1>=0 && c-1>=0 && d-1>=0){ 13 a = a-1; 14 b = b-1; 15 c = c-1; 16 d = d-1; 17 sum2++; 18 } 19 if(c-2>=0 && d-1>=0){ 20 c = c-2; 21 d = d-1; 22 sum3++; 23 } 24 if(b-3>=0){ 25 b = b-3; 26 sum4++; 27 } 28 if(a-1>=0 && d-1>=0){ 29 a = a-1; 30 d = d-1; 31 sum5++; 32 } 33 printf("%d\n%d\n%d\n%d\n%d",sum1,sum2,sum3,sum4,sum5); 34 }
标签:type bin 提交 div main c语言 style res scanf
原文地址:http://www.cnblogs.com/panweiwei/p/6592771.html