任何人都可以帮助解释为什么如果遵循 if 我不能拥有 else 吗?错误是说预期的表达,但我不知道这意味着什么
// 将变量声明为整数 int account, depAmount, withAmount;
Account *Account1=[[Account alloc] init];
// Prompt user to input account number
NSLog(@"Please input your account number here: ");
scanf("%i", &account); // Accept user input
if (account==1000)
NSLog(@"How much do you want to deposit: ");
scanf("%i", &depAmount);
[Account1 setaccountNumber: account];
[Account1 setbegBalance: 900.50];
[Account1 addDeposit: depAmount];
NSLog(@"How much do you want to withdrawl: ");
scanf("%i", &withAmount);
[Account1 setnewbegBalance: 900.50 + depAmount];
[Account1 subtractWithdrawal: withAmount];
NSLog(@"Your account number is: %i\nBeginning balance: %f\nNew balance is: %f", [Account1 accountNumber], [Account1 begBalance], [Account1 newBalance]);
else if (account==2000)
NSLog(@"How much do you want to deposit: ");
scanf("%i", &depAmount);
[Account1 setaccountNumber: account];
[Account1 setbegBalance: 700.75];
[Account1 addDeposit: depAmount];
NSLog(@"Your account number is: %i\nBeginning balance: %f\nNew balance is: %f", [Account1 accountNumber], [Account1 begBalance], [Account1 newBalance]);
else if (account==3000)
NSLog(@"How much do you want to deposit: ");
scanf("%i", &depAmount);