色婷婷狠狠18禁久久YY,CHINESE性内射高清国产,国产女人18毛片水真多1,国产AV在线观看

雞兔同籠代碼

傅智翔2年前26瀏覽0評論

雞兔同籠代碼?

//有雉兔同籠,上有三十五頭,下有九十四足,問雉兔各幾何?

int rabbit = 0; //兔子數量

int hen = 0; //雞數量

for (int i = 1 ; i < 35 ; i++ ) {

for (int j = 1 ; j < 35 ; j++ ) {

rabbit = i;

hen = j;

if (rabbit + hen == 35 && rabbit * 4 + hen * 2 == 94) {

NSLog(@"rabbit = %d , hen = %d",rabbit,hen); //rabbit = 12 , hen = 23

}

}

}