#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#define maxn 1000
using namespace std;
char str[maxn]; int change(char *s)
{
int k=strlen(s);
int pos;
int sum=;
for(int i=; i<k; i++)
{
if(s[i]=='(')
{
pos=i;
break;
}
}
int m;
if(s[pos+]=='')
{
m=;
}
else
m=s[pos+]-'';
int j=;
for(int i=pos-; i>=; i--)
{
sum+=(s[i]-'')*pow(m,j);
j++;
}
return sum;
} int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
int sum1=;
for(int i=; i<n; i++)
{
scanf("%s",str);
sum1+=change(str);
}
printf("%d\n",sum1);
}
return ;
}

hdu 2106 decimal system的更多相关文章

  1. HDOJ(HDU) 2106 decimal system(进制相互转换问题)

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

  2. HDU 2106 decimal system (进制转化求和)

    题意:给你n个r进制数,让你求和. 析:思路就是先转化成十进制,再加和. 代码如下: #include <iostream> #include <cstdio> #includ ...

  3. 十进制(decimal system)转换函数说明

    一,十进制(decimal system)转换函数说明 1,十进制转二进制 decbin() 函数,如下实例 echo decbin(12); //输出 1100 echo decbin(26); / ...

  4. hdu 2106

    #include <iostream> #include <cmath> #include <string.h> using namespace std; int ...

  5. decimal system 2016

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

  6. 杭电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=2 1.2.5 #include<stdio.h> ...

  7. HDU 3072 Intelligence System (强连通分量)

    Intelligence System Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Othe ...

  8. hdu 1690 Bus System(Dijkstra最短路)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1690 Bus System Time Limit: 2000/1000 MS (Java/Others ...

  9. HDU 4744 Starloop System(ZKW费用流)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4744 题意:三维空间n个点,每个点有一个wi值.每对点的距离定义为floor(欧拉距离),每对点之间建 ...

随机推荐

  1. python word操作深入

    python 把word转html:上传页面<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" &q ...

  2. rsyslog 直接kill进程,在重新启动会全部发送日志

    <pre name="code" class="html">jrhapt11:/root# ps -ef | grep rsyslog root 8 ...

  3. 如何在Windows服务程序中读写HKEY_CURRENT_USER注册表

    在服务程序中想要对注册表HKEY_CURRENT_USER下的内容进行读写,不会返回失败,但是始终无效.原因是: 1.服务运行在系统权限之下,而不是任何一个用户 2.HKEY_CURRENT_USER ...

  4. C++豆知识索引

    C++Memset误区 C++ 哈希表 C++类型转换[转] C++ sizeof C++ 路径中\\与/

  5. windows 删除服务命令

    在dos窗口下执行 sc delete  服务名( 例如 mysql) C:\Program Files\MySQL\MySQL Server 5.6\

  6. 给大家推荐一款代替Visio的在线作图工具ProcessOn

    过去作图的时候一直都是在用visio,每一次换了电脑使用都要重新安装,这大家都知道,最头疼的就是激活问题,曾经因为激活问题我“找遍了”正个互联网,最后还没找到...从08年开始到现在,visio用了这 ...

  7. 怎样把HTC G7的内存扩展到2GB

    介绍 HTC G7的内部存储只有148M,两年前买它的时候,android应用大多比较小巧,148M已经足够用了.随着android版本的不断升级,应用变得越来越臃肿,G7也变得越来越吃力.就我个人而 ...

  8. Socket tips: UDP Echo service - Server code

    #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/soc ...

  9. 最新的四款国外VPN,免费稳定,可以看国外网站的

    tyle="margin-top:20px; margin-right:0px; margin-bottom:0px; margin-left:0px; font-family:Arial; ...

  10. LDAP索引及缓存优化

    一.设置索引 索引将查找信息和 Directory Server 条目关联起来. Directory Server支持以下几种索引: 1出现索引 (pres) - 列出了具有特定属性的条目,与属性的值 ...