for f in range(20): for pregnant in range(f): covid = (f - pregnant) * 2 if (covid - pregnant == 3) and pregnant * 2 + (f - pregnant) + covid * 2 + (20 - covid) == 49: print(f'{20 - f}男,{f}女,{covid}阳,{pregnant}孕')複製代碼