比如输入: 12,23 输出: 
12 
*23 
------ 
36 
24 
------ 
276 

解决方案 »

  1.   

     public static void main(String[] args)
        {
            Integer one = 12;
            Integer two = 23;
            
            System.out.println(one * getFirstIndex(two));
            System.out.println(one * getLastIndex(two));
        }
        
        public static Integer getFirstIndex(Integer i)
        {
            return i / 10;
        }
        
        public static Integer getLastIndex(Integer i)
        {
            return i % 10;
        }第二步,不知道你怎么算的。
      

  2.   


    import java.util.Scanner;public class Test05 { public static void main(String args[]) { String str;
    Scanner s = new Scanner(System.in);
    str = s.next();
    System.out.println(str);
    String[] _str = str.split(","); int first = Integer.parseInt(_str[0]);
    int second = Integer.parseInt(_str[1]); System.out.println(first);
    System.out.println("*" + second);
    System.out.println("--------------");
    int count = 0;
    for (int i = 0; i < _str[1].length(); i++) {
    char ch = _str[1].charAt(_str[1].length() - 1 - i); System.out.println(first * Integer.parseInt(ch + ""));
    if (i == 0) {
    count += (first * Integer.parseInt(ch + "")) ;
    } else {
    count += (first * Integer.parseInt(ch + "")) * (i) * 10;
    }
    }

    System.out.println("--------------") ;
    System.out.println(count) ; }
    }12,32
    12,32
    12
    *32
    --------------
    24
    36
    --------------
    384