Posted on 2009-06-03 14:08
Hero 阅读(65)
评论(0) 编辑 收藏 引用 所属分类:
代码如诗--ACM
1 //1224 Accepted 15 136 441 C++
2
3 #include <iostream>
4 #include <string>
5 #include <algorithm>
6 using namespace std ;
7
8 const int size = 2000 ;
9
10 int tnum ;
11 int inn, inm ;
12
13 int main()
14 {
15 while( cin >> tnum )
16 {
17 while( tnum -- )
18 {
19 scanf( "%d %d", &inn, &inm ) ;
20
21 unsigned int out = 0 ;
22 int val = 0 ;
23 for( int i=1; i<=inm; i++ )
24 {
25 val = val * 10 + inn ;
26 out = out + val ;
27 }
28
29 cout << out << endl ;
30 }
31 }
32
33 return 0 ;
34 }