My issue
I have face in inputing Values
My code
/* package codechef; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Main
{
public static void main (String[] args)
{
X=1;
Y=2;
int a=X;
int b=Y;
int sum = a+b;
System.out.println(sum);
}
}
Learning course: Practice Java
Problem Link: CodeChef: Practical coding for everyone
@harsh_raj_7146
u have to take inputs like this.
// You don't need to add/edit anything to the below solution.
// Click on the SUBMIT button to solve your first problem on CodeChef.
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;
import java.util.*;
// Remember that the class name should be "Main" and should be "public".
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t>0){
int a = sc.nextInt();
int b = sc.nextInt();
int sum = a+b;
System.out.print(sum + "\n");
t--;
}
}
}