标签:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2106
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 3641 Accepted Submission(s):
2068
1 #include <iostream> 2 #include <cstdio> 3 #include <cmath> 4 5 using namespace std; 6 7 int main () 8 { 9 int t; 10 //har ch[110]; 11 int a,b,sum; 12 while (~scanf("%d",&t)) 13 { 14 sum=0; 15 while (t--) 16 { 17 int k=0; 18 scanf("%d(%d)",&a,&b); 19 while (a!=0) 20 { 21 sum+=a%10*pow(b,k++); 22 a/=10; 23 } 24 } 25 printf ("%d\n",sum); 26 } 27 return 0; 28 }
标签:
原文地址:http://www.cnblogs.com/qq-star/p/4244995.html