标签:
import java.util.Scanner; public class Main { static int getTheNumber(int num){ int number=1,i,j,flag=0; if(num==0){ return 0; } while(num>0){ i=num%10; if(flag!=0||i>0){ if(flag==0){ number=i; } else { number=number*10+i; } flag=1; } num/=10; } return number; } public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int m=sc.nextInt(); System.out.println(getTheNumber(getTheNumber(n)+getTheNumber(m))); } }
标签:
原文地址:http://www.cnblogs.com/watchfree/p/5346952.html