您好,我刚开始使用 small basic,我编译了一个简单的程序,但出了点问题。
Total = ((Loan*Loanp/100)+Expense)-Salary
TextWindow.WriteLine("Your Loan: ")
Loan = TextWindow.ReadNumber()
TextWindow.WriteLine ("Your Loan %: ")
TextWindow.ReadNumber(Loanp)
TextWindow.WriteLine ("Your Expense: ")
Expense = TextWindow.ReadNumber()
TextWindow.WriteLine ("Your Salary: ")
Salary = TextWindow.ReadNumber()
If (Loan*Loanp/100)+Expense > Salary Then
TextWindow.WriteLine ("Error : You are FOREVER in loan")
Else
TextWindow.WriteLine ("You savings are "+Total)
EndIf
答案总是零。当我尝试将数字设置为“总计”时,它可以工作。
Total = 100*3/100+50
TextWindow.WriteLine("Your Loan: ")
Loan = TextWindow.ReadNumber()
TextWindow.WriteLine ("Your Loan %: ")
TextWindow.ReadNumber(Loanp)
TextWindow.WriteLine ("Your Expense: ")
Expense = TextWindow.ReadNumber()
TextWindow.WriteLine ("Your Salary: ")
Salary = TextWindow.ReadNumber()
If (Loan*Loanp/100)+Expense > Salary Then
TextWindow.WriteLine ("Error : You are FOREVER in loan")
Else
TextWindow.WriteLine ("You savings are "+Total)
EndIf