hdu-2106-decimal system

原创 2013年12月05日 11:44:17
#include<stdio.h>
struct
{
int x,y;
}a[1005];
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
int i,t,sum=0;
for(i=0;i<n;i++)
{
scanf("%d(%d)",&a[i].x,&a[i].y);
if(a[i].y==10)
sum+=a[i].x;
else
{
t=1;
while(a[i].x)
{
sum+=a[i].x%10*t;
a[i].x/=10;
t*=a[i].y;
}
}
}
printf("%d\n",sum);
}
return 0;
}

相关文章推荐

decimal system hdu 2106

decimal system Time Limit : 3000/1000ms (Java/Other)   Memory Limit : 32768/32768K (Java/Other) To...

HDU2106 decimal system【进制+字符串切割】

decimal system Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

HDU 2106 decimal system(进制转换+模拟)

decimal system Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

2106:decimal system

Problem Description As we know , we always use the decimal system in our common life, even using ...

HDOJ 2106-decimal system【进制转换】

As we know , we always use the decimal system in our common life, even using the computer. If we wan...

杭电OJ(HDU)-ACMSteps-Chapter Two-《An Easy Task》《Buildings》《decimal system》《Vowel Counting》

http://acm.hdu.edu.cn/game/entry/problem/list.php?chapterid=1§ionid=21.2.5 #include /* 题意:找闰年。 ...

HDU 1.2.4 decimal system

decimal system Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Other...

杭电 decimal system

decimal system Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Tot...

decimal system

decimal system Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Oth...

hdu2106

分析:第一眼看上去,我就觉得此题有点难度,繁琐。其实不然,只是当初没有想到正确可行的计算方法,也一 时被上面说的东西给迷惑了 导致在考试的时候没敢动手去写。当初的第一反应的思路也是错的,老是从数的...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:hdu-2106-decimal system
举报原因:
原因补充:

(最多只允许输入30个字)