我在 杭电网 提交的 题 怎么 总是 Compilation Error
packagepack1;importjava.util.Scanner;publicclassSubmit{publicstaticvoidmain(String[]a...
package pack1;
import java.util.Scanner;
public class Submit {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int num1 = scanner.nextInt();
int num2 = scanner.nextInt();
int sum = num1 + num2;
System.out.println(sum);
}
} 展开
import java.util.Scanner;
public class Submit {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int num1 = scanner.nextInt();
int num2 = scanner.nextInt();
int sum = num1 + num2;
System.out.println(sum);
}
} 展开
1个回答
展开全部
package pack1;
import java.util.Scanner;
public class Submit {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int num1 = scanner.nextInt();
int num2 = scanner.nextInt();
int sum = num1 + num2;
System.out.println(sum);
}
}
改成:
//去掉 package pack1;这个包pack1只是在你的电脑上,并不在杭电ACM自动提交的服务器上
//他的服务器不识别pack1这个包
import java.util.Scanner;
//包含Main()方法的类的名字必须改成 Main 大小写不能错~~~~~~
//只有类名改成Main
public class Main{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int num1 = scanner.nextInt();
int num2 = scanner.nextInt();
int sum = num1 + num2;
System.out.println(sum);
}
}
import java.util.Scanner;
public class Submit {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int num1 = scanner.nextInt();
int num2 = scanner.nextInt();
int sum = num1 + num2;
System.out.println(sum);
}
}
改成:
//去掉 package pack1;这个包pack1只是在你的电脑上,并不在杭电ACM自动提交的服务器上
//他的服务器不识别pack1这个包
import java.util.Scanner;
//包含Main()方法的类的名字必须改成 Main 大小写不能错~~~~~~
//只有类名改成Main
public class Main{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int num1 = scanner.nextInt();
int num2 = scanner.nextInt();
int sum = num1 + num2;
System.out.println(sum);
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询