一个老人在临死前把三个儿子叫到跟前,告诉他们把19头牛分了,老大分1/2,老二分1/4,老三分1/5,说完就死了.按当地习俗,不能宰牛.问三个儿子各能分多少?
{int i;
for(i=1;i<=10;i++)
if(i+i/2+2*i/5==19)
printf("三个儿子分别分%d头,%d头和%d头.\n",i,i/2,2*i/5);
getch();
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!