标签:java
import java.util.Scanner; public class Main { public static void main(String args[]){ Scanner sc = new Scanner(System.in); int mod = 1000000007; while(sc.hasNext()){ String a = sc.next(); int num = sc.nextInt(); long res = 0; StringBuilder sb = new StringBuilder(); for(int i=0;i<num;i++){ if(a.length()*i<=10){ sb.append(a); res = (Long.parseLong(sb.toString())+res)%mod; }else{ res = (Long.parseLong(sb.toString())+res)%mod; } } System.out.println(res); } sc.close(); } }
标签:java
原文地址:http://blog.csdn.net/guorudi/article/details/42032537