日期:2014-05-20 浏览次数:20730 次
import java.util.Scanner; public class Test { public static void main(String[] arg) { Scanner input = new Scanner(System.in); int leftmoney; int salary; int give; int credit; System.out.println("Enter leftMoney:"); leftmoney = input.nextInt(); System.out.println("Enter salary:"); salary = input.nextInt(); System.out.println("Enter give:"); give = input.nextInt(); credit = leftmoney + salary - give; while (credit < 0) { System.out.println("Credit limit exceeded"); } } }