View Code of Problem 1

import java.util.Scanner;

public class Main{
  public static void main(String args[]){
    int a;
    Scanner s = new Scanner(System.in);
    a=s.nextInt;
    
    int b;
    Scanner t = new Scanner(System.in);
    b=t.nextInt;
    int c = a+b;
    System.out.println(c);
  }
}
/*
Main.java:7: error: cannot find symbol
    a=s.nextInt;
       ^
  symbol:   variable nextInt
  location: variable s of type Scanner
Main.java:11: error: cannot find symbol
    b=t.nextInt;
       ^
  symbol:   variable nextInt
  location: variable t of type Scanner
2 errors
*/

Double click to view unformatted code.


Back to problem 1