用JavaRE0了

P1001 A+B Problem

ljy05 @ 2023-05-06 17:11:54

最近学了Java,写了个A+B,RE0了,求助 源代码:

import java.util.Scanner;
class main{
    public static void main(){
        Scanner inp=new Scanner(System.in);
        System.out.println(inp.nextInt()+inp.nextInt());
    }
}

by Syncc @ 2023-05-06 17:22:39

import java.io.*;
import java.util.*;
public class Main {
    public static void main(String args[]) throws Exception {
        Scanner cin=new Scanner(System.in);
        int a = cin.nextInt(), b = cin.nextInt();
        System.out.println(a+b);
    }
}

拜托,题目下面有示范代码,你为什么不去看呢?


by ljy05 @ 2023-05-07 10:36:39

因为对比起来好像没问题


by ljy05 @ 2023-05-07 10:38:01

而且在自己电脑上运行也没问题


by cygnus_beta @ 2023-05-20 14:19:30

@ljy05 OJ的环境与本地会有不同,做题得遵守规范:D


by MrPython @ 2023-07-30 09:52:31

@ljy05 主类首字母大写


by ljy05 @ 2023-07-30 21:25:08

oh


|