import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
sc.nextLine();
for (int i = 0; i < n; i++)
{
String line = sc.nextLine();
String ss[] = line.split(" ");
int a = Integer
.parseInt(removeLeadingZero(reverse(removeLeadingZero(ss[0]))));
int b = Integer
.parseInt(removeLeadingZero(reverse(removeLeadingZero(ss[1]))));
System.out.println(removeLeadingZero(reverse((a + b) + "")));
}
}
static String removeLeadingZero(String s)
{
int index = 0;
while (s.charAt(index++) == '0')
;
return s.substring(index - 1);
}
static String reverse(String s)
{
return new StringBuilder(s).reverse().toString();
}
}
ZOJ-2001
最新推荐文章于 2017-01-16 10:21:04 发布