【发布时间】:2019-03-04 01:40:30
【问题描述】:
它告诉我字符串不能转换为系统... 但我真的不知道我犯了什么错误...... 在软件开发方面还是很新的.. 请帮帮我...
import java.util.Scanner;
public class Serioustake1
{
public static void main(String[]args)
{
int age;
String a = "Donald John Trump" ,b = "Height :",c = "Age :", d = "Name : ";
float height;
Scanner input = new Scanner(System.in);
System.out.print("Please enter the height of president:");
height=input.nextFloat();
System.out.print("Please enter the age of president:");
age=input.nextInt();
System.out.println("\n\n\t\t\t$$$$$$$$$$$$$$$$$$$$$$$$$$");
System.out.println("\t\t\t\tPresident Details");
System.out.println("\t\t\t$$$$$$$$$$$$$$$$$$$$$$$$$$$");
System formatString = String.format("%-15s%-10s\n%-15s%-10.1f\n%-15s%-10d",
d,a,b,height,c,age);
System.out.print(formatString);
}
}
【问题讨论】:
标签: jcreator