1089
Sample Input
1 5
10 20
Sample Output
6
1092
Sample Input
1 5
10 20
Sample Output
6
30
import java.util.*;
import java.math.*;
import java.io.*;
public class Main1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
while(in.hasNext())
{
int a,b;
a=in.nextInt();
b=in.nextInt();
int c;
c=a+b;
System.out.println(c);
}
}
}
1090
Sample Input
Sample Input
2 1 5 10 20
Sample Output
6 30
import java.util.*;
import java.math.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
while(in.hasNext())
{
int n;
n=in.nextInt();
for(int i=0;i<n;i++)
{
int a,b;
a=in.nextInt();
b=in.nextInt();
int c;
c=a+b;
System.out.println(c);
}
}
}
}
1091
1 5 10 20 0 0
Sample Output
6 30
import java.util.*;
import java.math.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
while(in.hasNext())
{
int a,b;
a=in.nextInt();
b=in.nextInt();
if(a==0&&b==0)
{
break;
}
else
{
System.out.println(a+b);
}
}
}
}
1092
Sample Input
4 1 2 3 4 5 1 2 3 4 5 0
Sample Output
10 15
import java.util.*; import java.io.*; import java.math.*; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner in = new Scanner(System.in); int n; while(in.hasNext()) { n=in.nextInt(); if(n!=0) { int b=0; for(int i=0;i<n;i++) { int a; a=in.nextInt(); b=b+a; } System.out.println(b); } } } }1093
Sample Input
2 4 1 2 3 4 5 1 2 3 4 5
Sample Output
10 15
import java.util.*; import java.math.*; import java.io.*; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner in = new Scanner(System.in); int n; n=in.nextInt(); for(int i=0;i<n;i++) { int m; m=in.nextInt(); int b=0; for(int c=0;c<m;c++) { int a; a=in.nextInt(); b=b+a; } System.out.println(b); } } }1094
Sample Input
4 1 2 3 4 5 1 2 3 4 5
Sample Output
10 15
import java.util.*; import java.math.*; import java.io.*; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner in = new Scanner(System.in); while(in.hasNext()) { int n; n=in.nextInt(); int b=0; for(int i=0;i<n;i++) { int a; a=in.nextInt(); b=b+a; } System.out.println(b); } } }1095
Sample Input
1 5 10 20
Sample Output
6 30
import java.util.*; import java.math.*; import java.io.*; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner in = new Scanner(System.in); while(in.hasNext()) { int a,b; a=in.nextInt(); b=in.nextInt(); int c; c=a+b; System.out.println(c); System.out.println( ); } } }1096
Sample Input
3 4 1 2 3 4 5 1 2 3 4 5 3 1 2 3
Sample Output
10 15 6
import java.util.*; import java.math.*; import java.io.*; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner in =new Scanner(System.in); while(in.hasNext()) { int n; n=in.nextInt(); for(int i=1;i<=n;i++) { int a; a= in.nextInt(); int c; c=0; for(int t=0;t<a;t++) { int b; b=in.nextInt(); c=c+b; } System.out.println(c); if(i!=n) { System.out.println( ); } } } } }