import java.util.Scanner;
public class CalorieCalculator {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// 假设每克食物的卡路里含量(这里以苹果为例,每克0.52卡路里,仅为示例数据)
double caloriesPerGram = 0.52;
System.out.print("请输入食物的重量(克): ");
double weight = scanner.nextDouble();
double totalCalories = weight * caloriesPerGram;
System.out.println("该食物的总卡路里为: " + totalCalories + " 卡路里");
scanner.close();
}
}