這個不太會寫代碼,知道怎麼寫的求教一下,大神們來幫幫忙吧,快死了⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯
int egg = 100;
double price = 1;
double prices = 0.8;
double payMoney = 0;
int number = 0;
Scanner sc = new Scanner(System.in);
Sytem.out.print("請輸入要購買的數量:");
number = sc.nextInt();
System.out.println();
if(number >= 10){
payMoney = number * 0.8;
}else{
payMoney = number * 1;
}
System.out.println("應付:" + payMoney + "元");
System.out.println("剩余雞蛋個數:" + (100 - number));