0
import java.util.Scanner;
import java.io.*;
public class Solution {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int x=sc.nextInt();
Double y= sc.nextDouble();
Scanner sc1=new Scanner(System.in);
String name = sc1.nextLine();
System.out.println("String: "+name);
System.out.println("Double: "+y);
System.out.println("Int: "+x);
}
}
入力:( 'ラム' の前に持っている5スペース)Javaでスキャナを使用して文字列の前にスペースを読み取る方法は?
343434343
343.434343
ram sdf
予想される出力:( 'ラム' の前に5のスペースを持っている)
ram sdf
343.434343
343434343