1.2.3 赋值

2019-02-02  本文已影响6人  harukou_ou
package test;

import java.util.Scanner;

public class Test1java {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        System.out.println("test hello world again:你好,こんにちは");
        int amount = 100;
        int price = 0;
        Scanner in = new Scanner(System.in);
        
        System.out.print("请输入票面:");
        amount = in.nextInt();
        
        System.out.print("请输入价格:");      
        price = in.nextInt();
        
        System.out.print("输出找零:");
        System.out.println(amount+"-"+price+"="+(amount-price));
    }

}
上一篇 下一篇

猜你喜欢

热点阅读