多量栄養素計算機を作っています。ユーザーがエラーを起こした場合、この計算機は再起動して main() に戻ります。ただし、コードで main() を使用すると、コードが 2 回実行されて表示されると思います。
ここに私のコードへのリンクがあります: http://pastebin.com/FMqf2aRS
*******Welcome to the MACRONUTRIENT CALCULATOR********
Enter your calorie deficit: 30
Percentage of Protein: 30
Percent of Carbohydrates: 40
Percentage of Fats: 40
Total percentages surpassed 100! Please reenter percentages.
*******Welcome to the MACRONUTRIENT CALCULATOR********
Enter your calorie deficit: 2200
Percentage of Protein: 30
Percent of Carbohydrates: 30
Percentage of Fats: 40
You must eat 660.0 calories of protein which is equivalent to 165.0 grams of protein.
You must eat 880.0 calories of fat which is equivalent to 97.7777777778 grams of fat.
You must eat 660.0 calories of carbohydrates which is equivalent to 73.3333333333 grams of carbohydrates.
You must eat 9.0 calories of protein which is equivalent to 2.25 grams of protein.
You must eat 12.0 calories of fat which is equivalent to 1.33333333333 grams of fat.
You must eat 12.0 calories of carbohydrates which is equivalent to 1.33333333333 grams of carbohydrates.
これが起こらないようにするためにこれにアプローチする別の方法はありますか?