昨天开始看书的,所以找个最简单的AC下。

 

代码:

import java.util.*;

// public class ab
public class Main
{
   public static void main(String[]  args)
   {
      Scanner sc = new Scanner (System.in);   
      int x,y,result;

      x = sc.nextInt();
      y = sc.nextInt();
      result = x + y;
      System.out.println(result);
   }
}

 

    必须是public class Main,否则compile error.

    为什么呢?暂时不太清楚,继续学习!

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-10
  • 2021-09-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-29
  • 2021-08-07
  • 2021-08-24
  • 2022-12-23
  • 2021-07-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案