23,407
社区成员
发帖
与我相关
我的任务
分享
import java.io.*;// you are importing the header files from the directory io in java , we put " * " at the end because that means everyfiles in that io directory is imported Source(s):
public class Sep59 {
public static void main(String[]args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
//get noun
System.out.println("Enter your first number: ");
String ans1 = in.readLine();
//get adj
System.out.println("Enter your second number: ");
String ans2 = in.readLine();
//get adj
System.out.println("Enter your third number: ");
String ans3 = in.readLine();
//get verb
System.out.println("Enter your fourth number: ");
String ans4 = in.readLine();
//get adj 改动处:类型转换
int x = Integer.valueOf(ans1) + Integer.valueOf(ans2) + Integer.valueOf(ans3) + Integer.valueOf(ans4);
System.out.print("The total is" + x);
}
}