作者在 2013-04-29 16:13:41 发布以下内容
#include <stdio.h>
#include <math.h>
int main(void)
{
int line, num, band, sum, i;
char ch_l, ch_r;
while(scanf("%d", &line) != EOF)
{
if(line == 0) break;
sum = 0;
while(line--)
{
i = 0;
scanf("%d%c%d%c", &num, &ch_l, &band, &ch_r);
while(num)
{
sum += num % 10 * pow(band,i++);
num /= 10;
}
}
printf("%d\n", sum);
}
return 0;
}