📜  乳胶中的算法转换器 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:00.178000             🧑  作者: Mango

代码示例3
import java.util.Scanner;
public class code
{
    public static void main(String[] args) 
    {
        double i;
        Scanner sc = new Scanner (System.in);
        i = sc.nextDouble();
        byte code = (byte) i;
        short num = (short) i;
        int myInt = (int) i;
        float floating = (float) i;
        long nums = (long) i;
    System.out.println("byte:"+code);   
    System.out.println("short:"+num); 
    System.out.println("int:"+myInt);
    System.out.println("float:"+floating);
    System.out.println("long:"+nums);
        
    }
}