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));
}
}