1089
Input
1 5
10 20
Ouput
6
30
import java.util.Scanner;
public class Main {
public static void main(String args[])
{
int a,b;
Scanner reader=new Scanner(System.in);
while(reader.hasNext())
{
a=reader.nextInt();
b=reader.nextInt();
System.out.println(a+b);
}
}
}
1090
Input
2
1 5
10 20
Ouput
6
30
import java.util.Scanner;
public class Main {
public static void main(String args[])
{
int a,b,n,i;
Scanner reader=new Scanner(System.in);
n=reader.nextInt();
for(i=0;i<n;i++)
{
a=reader.nextInt();
b=reader.nextInt();
System.out.println(a+b);
}
}
}
1091
Input
1 5
10 20
0 0
Ouput
6
30
import java.util.Scanner;
public class Main {
public static void main(String args[])
{
int a,b;
Scanner reader=new Scanner(System.in);
while(reader.hasNext())
{
a=reader.nextInt();
b=reader.nextInt();
if(a==0&&b==0)
break;
System.out.println(a+b);
}
}
}
1092
Input
4 1 2 3 4
5 1 2 3 4 5
0
Ouput
10
15
import java.util.Scanner;
public class Main {
public static void main(String args[])
{
int b,n,sum;
Scanner reader=new Scanner(System.in);
while(reader.hasNext())
{
sum=0;
n=reader.nextInt();
if(n==0)
break;
else
{
for(int i=0;i<n;i++)
{
b=reader.nextInt();
sum+=b;
}
System.out.println(sum);
}
}
}
}
1093
Input
2
4 1 2 3 4
5 1 2 3 4 5
Ouput
10
15
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
int a, b, n, sum;
Scanner reader = new Scanner(System.in);
n = reader.nextInt();
for (int j = 0; j < n; j++) {
a = reader.nextInt();
sum = 0;
for (int i = 0; i < a; i++) {
b = reader.nextInt();
sum += b;
}
System.out.println(sum);
}
}
}
1094
Input
4 1 2 3 4
5 1 2 3 4 5
Ouput
10
15
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
int a, b, n, sum;
Scanner reader = new Scanner(System.in);
while(reader.hasNext()) {
a = reader.nextInt();
sum = 0;
for (int i = 0; i < a; i++) {
b = reader.nextInt();
sum += b;
}
System.out.println(sum);
}
}
}
1095
Input
1 5
10 20
Ouput
6
30
import java.util.Scanner;
public class Main{
public static void main(String args[]) {
int a, b, n, sum;
Scanner reader = new Scanner(System.in);
while(reader.hasNext()) {
a = reader.nextInt();
b = reader.nextInt();
System.out.println(a+b);
System.out.println();
}
}
}
1096
Input
3
4 1 2 3 4
5 1 2 3 4 5
3 1 2 3
Ouput
10
15
6
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
int a, b, n, sum;
Scanner reader = new Scanner(System.in);
while (reader.hasNext()) {
n = reader.nextInt();
for (int j = 1; j <= n; j++) {
sum = 0;
b = reader.nextInt();
for (int i = 0; i < b; i++) {
a = reader.nextInt();
sum += a;
}
System.out.println(sum);
if(j!=n)
System.out.println();
}
}
}
}